/* ===== Article Layout ===== */
.article-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--spacing-xl);
  align-items: start;
  min-width: 0;
}
.article-wrap > * {
  min-width: 0;
}
.article-main-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* ===== Left Toolbar ===== */
.article-toolbar {
  position: fixed;
  top: 80px;
  z-index: 20;
  width: 56px;
}
@media (min-width: 1376px) {
  .article-toolbar {
    left: calc((100vw - 1240px) / 2 - 56px - var(--spacing-xl));
  }
}
@media (max-width: 1375px) and (min-width: 1024px) {
  .article-toolbar {
    left: var(--spacing-lg);
  }
}
.tb-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tb-actions > .tb-btn:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tb-actions > .tb-btn:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.tb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 0 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  transition: color .2s, background .15s;
  position: relative;
  text-decoration: none;
}
.tb-btn:hover {
  color: var(--c-primary);
  background: var(--c-primary-light);
}
.tb-btn .iconfont {
  font-size: 1.2rem;
  transition: transform .2s;
}
.tb-btn:hover .iconfont {
  transform: scale(1.1);
}
.tb-btn span {
  line-height: 1;
  pointer-events: none;
}
.tb-btn + .tb-btn {
  border-top: 1px solid var(--c-border-light);
}
.tb-like.active .iconfont,
.tb-like:hover .iconfont {
  color: var(--c-danger);
}
.tb-fav.active .iconfont,
.tb-fav:hover .iconfont {
  color: var(--c-warning);
}
.tb-comment:hover .iconfont {
  color: var(--c-primary);
}
.tb-share:hover .iconfont {
  color: var(--c-secondary);
}

/* ===== Share Popup ===== */
.tb-share {
  position: relative;
}
.tb-share-popup {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
  white-space: nowrap;
}
.tb-share-popup::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--c-surface);
}
.tb-share:hover .tb-share-popup {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tb-share-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  transition: color .2s, background .15s;
  position: relative;
}
.tb-share-item:hover {
  color: var(--c-primary);
  background: var(--c-primary-light);
}
.tb-share-item .iconfont {
  font-size: 1.1rem;
}
.tb-share-item span {
  pointer-events: none;
}
.tb-share-qrcode {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 31;
  text-align: center;
}
.tb-share-qrcode img {
  width: 120px;
  height: 120px;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
  max-width: none;
}
.tb-share-qrcode span {
  display: block;
  margin-top: 6px;
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: 1.4;
  pointer-events: none;
}
.tb-share-qrcode::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--c-surface);
}
.tb-share-wechat:hover .tb-share-qrcode {
  display: block;
}

/* ===== Breadcrumb ===== */
.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  padding: var(--spacing-md) 0;
  flex-wrap: wrap;
}
.article-breadcrumb a {
  color: var(--c-text-muted);
}
.article-breadcrumb a:hover {
  color: var(--c-primary);
}
.article-breadcrumb .sep {
  color: var(--c-border);
}
.article-breadcrumb .current {
  color: var(--c-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Article Card ===== */
.article-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.article-card > :last-child {
  padding-bottom: 32px;
}
.article-card-header {
  padding: 32px 32px 0;
}
.article-card-header h1 {
  font-size: 1.714rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--c-text);
  margin: 0;
}
.article-card-meta {
  margin-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  flex-wrap: wrap;
  margin-bottom: 0;
}
.article-card-meta i {
  margin-right: 3px;
}
.article-card-image {
  padding: 24px 32px 0;
}
.article-card-image img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* ===== Article Content Typography ===== */
.article-card-body {
  padding: 24px 32px 0;
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--c-text);
  word-wrap: break-word;
}
.article-card-body h2 {
  font-size: var(--text-lg);
  margin: var(--spacing-xl) 0 var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--c-border-light);
}
.article-card-body h3 {
  font-size: var(--text-md);
  margin: var(--spacing-lg) 0 var(--spacing-sm);
}
.article-card-body h4 {
  font-size: var(--text-base);
  margin: var(--spacing-md) 0 var(--spacing-sm);
}
.article-card-body p {
  margin-bottom: var(--spacing-md);
}
.article-card-body a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-card-body a:hover {
  color: var(--c-primary-hover);
}
.article-card-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: var(--spacing-md) 0;
  display: block;
}
.article-card-body strong,
.article-card-body b {
  font-weight: 700;
}
.article-card-body em,
.article-card-body i {
  font-style: italic;
}
.article-card-body ul,
.article-card-body ol {
  margin: 0 0 var(--spacing-md) var(--spacing-lg);
}
.article-card-body ul li {
  list-style-type: disc;
  margin-bottom: 4px;
}
.article-card-body ol li {
  list-style-type: decimal;
  margin-bottom: 4px;
}
.article-card-body blockquote {
  margin: var(--spacing-md) 0;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--c-primary-light);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-secondary);
  line-height: 1.7;
}
.article-card-body blockquote p:last-child {
  margin-bottom: 0;
}
.article-card-body code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--c-bg);
  color: var(--c-danger);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.article-card-body pre {
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--c-code-bg);
  color: var(--c-code-text);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--spacing-md) 0;
  line-height: 1.6;
  border-left: 4px solid var(--c-secondary);
}

/* Copy button for code blocks */
.news-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-family: inherit;
  color: #94a3b8;
  background: rgba(30,41,59,.8);
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 4px;
  cursor: pointer;
  z-index: 1;
  transition: color .2s, border-color .2s;
  line-height: 1.5;
}
.article-card-body pre:hover .news-copy-btn {
  display: inline-block;
}
.news-copy-btn:hover {
  color: #e2e8f0;
  border-color: #e2e8f0;
}
.article-card-body pre code {
  font-size: inherit;
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}
.article-card-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: var(--text-sm);
}
.article-card-body table th,
.article-card-body table td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.article-card-body table th {
  background: var(--c-bg);
  font-weight: 700;
  color: var(--c-text);
}
.article-card-body table tr:nth-child(even) {
  background: var(--c-border-light);
}
.article-card-body table tr:hover {
  background: var(--c-primary-light);
}
.article-card-body hr {
  border: none;
  height: 1px;
  background: var(--c-border);
  margin: var(--spacing-xl) 0;
}
.article-card-body iframe {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: var(--spacing-md) 0;
}

/* ===== Article Tags ===== */
.article-card-tags {
  padding: 24px 32px 32px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  border-top: 1px solid var(--c-border-light);
}
.article-tags-label {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.article-tag {
  text-decoration: none;
}

/* ===== Sidebar ===== */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  position: sticky;
  top: calc(var(--header-h) + var(--spacing-lg));
}
.sidebar-related-list {
  list-style: none;
}
.sidebar-related-list li {
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border-light);
}
.sidebar-related-list li:last-child {
  border-bottom: none;
}
.sidebar-related-list li a {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
  text-decoration: none;
}
.sidebar-related-list li a:hover {
  color: var(--c-primary);
}

@media (max-width: 1023px) {
  .article-wrap {
    grid-template-columns: 1fr;
  }
  .article-toolbar {
    display: none;
  }
  .article-sidebar {
    display: none;
  }
  .article-card-header {
    padding: 24px 24px 0;
  }
  .article-card-header h1 {
    font-size: var(--text-lg);
  }
  .article-card-image {
    padding: 20px 24px 0;
  }
  .article-card-body {
    padding: 20px 24px 0;
  }
  .article-card > :last-child {
    padding-bottom: 24px;
  }
  .article-card-tags {
    padding: 20px 24px 24px;
  }
}

@media (max-width: 767px) {
  .article-card-header {
    padding: 20px 20px 0;
  }
  .article-card-image {
    padding: 16px 20px 0;
  }
  .article-card-body {
    padding: 16px 20px 0;
  }
  .article-card-body pre {
    font-size: var(--text-sm);
  }
  .article-card > :last-child {
    padding-bottom: 20px;
  }
  .article-card-tags {
    padding: 14px 20px 20px;
  }
}

/* ===== Related News ===== */
.related-news {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
}
.related-news-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 var(--spacing-md);
  padding-left: 14px;
  position: relative;
}
.related-news-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  background: var(--c-primary);
  border-radius: 3px;
}
.related-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}
.related-news-item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  text-decoration: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.related-news-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.related-news-thumb {
  aspect-ratio: 300 / 190;
  overflow: hidden;
  background: var(--c-bg);
  border-radius: var(--radius-md);
}
.related-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.related-news-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-border-light) 25%, #fafafa 50%, var(--c-border-light) 75%);
}
.related-news-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.related-news-item:hover .related-news-name {
  color: var(--c-primary);
}

@media (max-width: 1023px) {
  .related-news {
    padding: var(--spacing-md);
  }
}

@media (max-width: 640px) {
  .related-news-grid {
    grid-template-columns: 1fr;
  }
}
