/* ==========================================================================
   知流内容站 · Content Styles (博客 + 每日资讯 + 组件追踪 + 移动端适配)
   规范依据：SPEC-V2-DELTA.md §2, §4, §8.1, §8.2
   ========================================================================== */

html, body {
  min-height: 100%;
  /* overflow-x: hidden 会让 body 变成滚动容器，导致 position: sticky
     的顶栏与右侧目录全部失效（2026-11-19 线上实测：两者都随页面滚走）。
     改用 clip：同样裁掉横向溢出，但不创建滚动容器，sticky 恢复正常。 */
  overflow-x: clip;
}

.content-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   顶部导航栏 (无边框、无阴影，下方柔和渐隐遮罩)
   ========================================================================== */
.site-topbar {
  position: sticky;
  top: 0;
  height: 60px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  z-index: 30;
}
.site-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 16px;
  background: linear-gradient(to bottom, var(--surface) 10%, transparent 100%);
  pointer-events: none;
}
.topbar-inner {
  max-width: var(--max-w-content);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex-shrink: 0;
}
.brand-link-text {
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-link .mood-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  background: var(--surface-popover);
  backdrop-filter: blur(18px);
  box-shadow: var(--elevation-popover);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--on-surface-variant);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease-emphasized) 1s,
              transform 0.25s var(--ease-emphasized) 1s;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-link:hover .mood-tooltip {
  opacity: 1;
  transform: translateY(0);
}
.mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
}

.center-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.center-nav-link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: var(--on-surface-variant);
  padding: 8px 4px;
  transition: color 0.15s ease;
}
.center-nav-link:hover {
  color: var(--on-surface);
}
.center-nav-link.active {
  color: var(--on-surface);
}
.center-nav-link.active::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.chat-pill-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.chat-pill-btn:hover {
  filter: brightness(0.97);
}

/* 应用切换器 */
.app-switcher-wrap {
  position: relative;
}
.unread-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  pointer-events: none;
  display: none;
}
.unread-dot.show {
  display: block;
}
.app-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: var(--surface-popover);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 6px;
  box-shadow: var(--elevation-popover);
  opacity: 0;
  transform: scale(0.95) translateY(-6px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s var(--ease-emphasized), transform 0.22s var(--ease-emphasized);
  z-index: 45;
}
.app-switcher-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.switcher-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  color: var(--on-surface);
  transition: background-color 0.15s ease;
}
.switcher-item:hover {
  background-color: var(--state-hover);
}
.switcher-item.current {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 500;
}
.switcher-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* 主题切换浮层 */
.theme-menu-wrap {
  position: relative;
}
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 156px;
  background: var(--surface-popover);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 6px;
  box-shadow: var(--elevation-popover);
  opacity: 0;
  transform: scale(0.95) translateY(-6px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.16s var(--ease-emphasized), transform 0.2s var(--ease-emphasized);
  z-index: 50;
}
.theme-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  color: var(--on-surface);
  text-align: left;
}
.menu-item:hover {
  background: var(--state-hover);
}
.menu-item.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 500;
}

/* ==========================================================================
   主容器
   ========================================================================== */
.content-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 20px 24px 80px;
}

/* 首页顶部小号问候 */
.home-sub-greeting {
  font-size: 13.5px;
  color: var(--on-surface-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 32px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.section-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 今日导语卡片 */
.digest-lead-card {
  background-color: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.digest-lead-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 8px;
}
.digest-lead-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.digest-lead-card p {
  font-size: 15px;
  line-height: 1.72;
  color: var(--on-surface);
}

/* 无分割线列表项 */
.clean-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clean-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: transparent;
  transition: background-color 0.16s ease;
  cursor: pointer;
}
.clean-item:hover {
  background-color: var(--surface-container-low);
}
.clean-item.is-read .item-title {
  color: var(--on-surface-variant);
  font-weight: 400;
}
.item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--on-surface-muted);
  margin-bottom: 4px;
}
.item-title {
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--on-surface);
  margin-bottom: 5px;
}
.item-summary {
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-why {
  margin-top: 6px;
  font-size: 13px;
  color: var(--on-surface-variant);
}
.item-why strong {
  color: var(--primary);
  font-weight: 500;
}
.item-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.item-actions-hover {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.clean-item:hover .item-actions-hover {
  opacity: 1;
}
.text-action-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-variant);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.text-action-btn:hover {
  background: var(--state-hover);
  color: var(--on-surface);
}
.text-action-btn.active {
  color: var(--primary);
  background: var(--secondary-container);
}
.text-action-btn.primary {
  color: var(--primary);
}
.ask-ai-tonal-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  transition: filter 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}
.ask-ai-tonal-btn:hover {
  filter: brightness(0.95);
}
.ask-ai-tonal-btn:active {
  transform: scale(0.97);
}
.home-comp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-comp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-container-low);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.home-comp-item:hover {
  background: var(--surface-container);
}
.home-comp-left {
  min-width: 0;
}
.home-comp-name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 7px;
}
.home-comp-meta {
  font-size: 12px;
  color: var(--on-surface-muted);
  margin-top: 2px;
}
.empty-illustrated {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
}
.empty-illustrated svg {
  width: 64px;
  height: 64px;
  color: var(--primary);
  opacity: 0.78;
}
.empty-illustrated-title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--on-surface);
}
.empty-illustrated-desc {
  font-size: 13px;
  color: var(--on-surface-muted);
  max-width: 340px;
  line-height: 1.55;
}
.mermaid-card {
  background-color: var(--surface-container-low);
  border-radius: var(--radius-lg);
  margin: 16px 0;
  overflow: hidden;
}
.mermaid-diagram {
  padding: 16px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
}
.mermaid-fallback {
  width: 100%;
  margin: 0;
  padding: 4px 2px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.mermaid-error-note {
  font-size: 12px;
  color: var(--on-surface-muted);
  margin-bottom: 6px;
}
.math-block {
  margin: 14px 0;
  padding: 10px 14px;
  overflow-x: auto;
  text-align: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-container-low) 65%, transparent);
}
.math-inline {
  padding: 0 2px;
}
.instant-dismiss,
.instant-dismiss * {
  transition: none !important;
}

/* ==========================================================================
   博客列表页
   ========================================================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.page-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.category-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar {
  display: none;
}
.cat-pill {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  color: var(--on-surface-variant);
  background: var(--surface-container-low);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cat-pill:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}
.cat-pill.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 500;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 36px;
  align-items: start;
}
.blog-article-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.blog-article-row {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  transition: background-color 0.16s ease;
  cursor: pointer;
}
.blog-article-row:hover {
  background-color: var(--surface-container-low);
}
.blog-article-row .item-title {
  font-size: 20px;
  margin-bottom: 6px;
}

.blog-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}
.aside-card {
  background: var(--surface-container-low);
  border-radius: 20px;
  padding: 16px 18px;
}
.aside-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-muted);
  margin-bottom: 10px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-cloud .pill-tag {
  cursor: pointer;
}
.tag-cloud .pill-tag.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 500;
}
.aside-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aside-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--on-surface-variant);
  text-align: left;
}
.aside-link-item:hover {
  background: var(--state-hover);
  color: var(--on-surface);
}
.aside-link-item.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 500;
}

.rss-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.pill-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-container);
  color: var(--on-surface);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pill-btn:hover {
  background: var(--surface-container-high);
}
.pill-btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.pill-btn.secondary {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.load-more-wrap {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   博客详情页 (阅读体验为核心)
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--brand-gradient);
  z-index: 60;
  transition: width 0.08s linear;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 230px;
  gap: 40px;
  justify-content: center;
  align-items: start;
}
.article-main {
  min-width: 0;
}
.article-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}
.mobile-toc-btn {
  display: none;
}

.outdated-banner {
  background: var(--warning-container);
  color: var(--on-warning-container);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.article-header {
  margin-bottom: 28px;
}
.article-title {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.article-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--on-surface-muted);
}

/* 正文排版 */
.prose {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--on-surface);
  word-break: break-word;
}
.prose p {
  margin-bottom: 1.05em;
}
.prose h2, .prose h3, .prose h4 {
  font-weight: 600;
  line-height: 1.35;
  margin-top: 2em;
  margin-bottom: 0.75em;
  scroll-margin-top: 76px;
}
.prose h2 { font-size: 1.42em; }
.prose h3 { font-size: 1.18em; }
.prose h4 { font-size: 1.04em; }
.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 1.05em;
}
.prose li {
  margin-bottom: 0.35em;
}
.prose mark {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  padding: 1px 5px;
  border-radius: 5px;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--surface-container-high);
  padding: 2px 6px;
  border-radius: 6px;
}
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose blockquote {
  border-left: 3px solid var(--outline-variant);
  padding: 4px 0 4px 16px;
  color: var(--on-surface-variant);
  margin: 1.2em 0;
}

/* GitHub 提示块 (Note / Tip / Warning / Danger) */
.callout-block {
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin: 1.25em 0;
  font-size: 15px;
  line-height: 1.65;
}
.callout-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.callout-note { background: var(--info-container); color: var(--on-info-container); }
.callout-tip { background: var(--success-container); color: var(--on-success-container); }
.callout-warning { background: var(--warning-container); color: var(--on-warning-container); }
.callout-danger { background: var(--error-container); color: var(--on-error-container); }

/* 代码块与表格与图片灯箱 */
.code-card {
  background-color: var(--surface-container-high);
  border-radius: 14px;
  margin: 1.2em 0;
  overflow: hidden;
}
.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px 7px 16px;
  background: var(--surface-container);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--on-surface-variant);
}
.code-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-copy-btn,
.code-collapse-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 8px;
  color: var(--on-surface-variant);
}
.code-copy-btn {
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.code-card:hover .code-copy-btn,
.code-copy-btn.copied {
  opacity: 1;
}
.code-copy-btn:hover,
.code-collapse-btn:hover {
  background: var(--state-hover);
  color: var(--on-surface);
}
.code-card pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
}
.code-card.collapsed pre {
  max-height: 280px;
  overflow-y: hidden;
}
.code-card pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.2em 0;
  border-radius: 14px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.prose th {
  background: var(--surface-container);
  font-weight: 500;
  text-align: left;
  padding: 10px 14px;
}
.prose td {
  padding: 10px 14px;
  border-top: 1px solid color-mix(in srgb, var(--outline-variant) 45%, transparent);
}

.prose figure {
  margin: 1.4em 0;
  text-align: center;
}
.prose figure img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
}
.prose figcaption {
  font-size: 13px;
  color: var(--on-surface-muted);
  margin-top: 8px;
}

/* 右侧吸顶目录 TOC */
.toc-aside {
  align-self: stretch;
}
.toc-sticky {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-muted);
  margin-bottom: 10px;
  padding-left: 10px;
}
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-link {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--on-surface-variant);
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-link.level-3 {
  padding-left: 22px;
  font-size: 12.5px;
}
.toc-link:hover {
  color: var(--on-surface);
}
.toc-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

/* 文末操作、上下篇、相关文章 */
.article-end-box {
  margin-top: 40px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.article-ask-bar {
  background: var(--surface-container-low);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.prev-next-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.prev-next-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.prev-next-card:hover {
  background: var(--surface-container);
}

/* 选中文字浮动「问 AI」按钮 */
.selection-ask-btn {
  position: fixed;
  z-index: 65;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--elevation-popover);
  display: none;
  align-items: center;
  gap: 4px;
}
.selection-ask-btn.show {
  display: inline-flex;
}

/* ==========================================================================
   每日资讯 + 组件版本追踪
   ========================================================================== */
.news-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.news-view-switch {
  display: inline-flex;
  background: var(--surface-container-low);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
}
.view-tab-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--on-surface-variant);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.view-tab-btn.active {
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.news-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.date-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-container-low);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
}

.security-alert-banner {
  background: var(--error-container);
  color: var(--on-error-container);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.security-alert-banner h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.news-section-block {
  margin-bottom: 30px;
}
.news-section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-muted);
  margin-bottom: 10px;
}

/* 组件版本追踪网格 */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.tracker-card {
  background-color: var(--surface-container-low);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.18s ease;
}
.tracker-card:hover {
  background-color: var(--surface-container);
}
.tracker-new-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}
.tracker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
  padding-right: 12px;
}
.tracker-ver {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}
.tracker-meta {
  font-size: 12px;
  color: var(--on-surface-muted);
}
.tracker-note {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 组件时间线弹窗 */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 0;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}
.timeline-item {
  padding-left: 16px;
  border-left: 2px solid var(--outline-variant);
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline-ver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.breaking-box {
  margin-top: 8px;
  background: var(--error-container);
  color: var(--on-error-container);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.55;
}

/* 归档筛选条 */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter-input {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-container-low);
  font-size: 13.5px;
  min-width: 200px;
}
.filter-select {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-container-low);
  font-size: 13px;
  color: var(--on-surface);
  cursor: pointer;
}

/* 空状态 */
.empty-box {
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 36px 24px;
  text-align: center;
  color: var(--on-surface-muted);
  font-size: 14px;
}

/* ==========================================================================
   弹窗 / 灯箱 / Ctrl+K 命令面板
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-scrim);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 80;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.cmdk-backdrop {
  place-items: start center;
  padding-top: 12vh;
}
.cmdk-dialog {
  width: min(560px, 94vw);
  background: var(--surface-popover);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-2xl);
  padding: 12px;
  box-shadow: var(--elevation-popover);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
}
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 10px;
}
.cmdk-input-row input {
  flex: 1;
  font-size: 15.5px;
  min-width: 0;
}
.cmdk-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.popover-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-muted);
  padding: 6px 12px 4px;
}
.suggest-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-lg);
  text-align: left;
}
.suggest-item:hover {
  background: var(--state-hover);
}
.suggest-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.suggest-item-body {
  flex: 1;
  min-width: 0;
}
.suggest-item-title {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggest-item-desc {
  font-size: 12px;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m3-dialog {
  width: min(580px, 94vw);
  background: var(--surface-popover);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-2xl);
  padding: 22px 24px;
  box-shadow: var(--elevation-popover);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.dialog-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-popover);
}

.sheet-handle {
  display: none;
}

.snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  background: var(--on-surface);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s var(--ease-emphasized);
  z-index: 120;
}
.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 页脚 */
.site-footer {
  max-width: var(--max-w-content);
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--on-surface-muted);
}

/* ==========================================================================
   每日 AI 简报视图 (v2.1)
   ========================================================================== */
.briefing-date-select {
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.briefing-hero-card {
  background-color: var(--surface-container-low);
  border-radius: var(--radius-2xl);
  padding: 24px 26px;
  margin-bottom: 22px;
}
.briefing-hero-title {
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 6px 0 12px;
  color: var(--on-surface);
}
.briefing-lead-text {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--on-surface);
  overflow-wrap: anywhere;
}
.briefing-lead-text code,
.briefing-prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--surface-container-high);
  padding: 1px 6px;
  border-radius: 6px;
  word-break: break-word;
}
.briefing-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.briefing-num-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.briefing-stars-inline {
  font-size: 12px;
  color: var(--primary);
  letter-spacing: 1px;
}

.briefing-items-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}
.briefing-item-card {
  background-color: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.briefing-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.briefing-item-head-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.briefing-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.briefing-item-meta {
  font-size: 12.5px;
  color: var(--on-surface-muted);
}
.briefing-item-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--on-surface);
  margin-bottom: 14px;
}

/* 简报新闻配图（紧凑缩略图横排，点击放大，裂图自动隐藏） */
.briefing-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.briefing-img-fig {
  margin: 0;
  width: 176px;
  max-width: 100%;
  flex: 0 0 auto;
  min-width: 0;
}
.briefing-img {
  display: block;
  width: 176px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-container);
  cursor: zoom-in;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.briefing-img:hover {
  transform: scale(1.02);
}
.briefing-img-fig figcaption {
  font-size: 11.5px;
  color: var(--on-surface-muted);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.briefing-section-block {
  margin-bottom: 14px;
}
.briefing-block-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.briefing-prose {
  font-size: 15px;
  line-height: 1.75;
  color: var(--on-surface);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.briefing-prose p + p {
  margin-top: 0.75em;
}
.briefing-ul {
  padding-left: 20px;
  margin: 6px 0;
}
.briefing-ul li + li {
  margin-top: 4px;
}
.briefing-flow {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-container);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--on-surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.briefing-learn-box {
  background: var(--surface-container);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.briefing-learn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}
.briefing-stars {
  font-size: 13.5px;
  letter-spacing: 1px;
}

.briefing-item-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.briefing-meta-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.briefing-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-muted);
  padding-top: 3px;
  flex-shrink: 0;
}
.briefing-tag-list,
.briefing-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.briefing-source-link {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  background: var(--surface-container);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: background-color 0.15s ease;
}
.briefing-source-link:hover {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.briefing-source-text {
  font-size: 12.5px;
  color: var(--on-surface-variant);
  padding: 3px 8px;
  background: var(--surface-container);
  border-radius: var(--radius-pill);
}

.briefing-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.briefing-insight-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  min-width: 0;
}
.briefing-priority-card {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  min-width: 0;
}
.briefing-priority-card .briefing-prose,
.briefing-priority-card .briefing-insight-title {
  color: var(--on-tertiary-container);
}
.briefing-priority-card .briefing-prose code {
  background: color-mix(in srgb, var(--on-tertiary-container) 12%, transparent);
}
.briefing-insight-title {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--on-surface);
}

/* ==========================================================================
   平板与桌面收窄适配 (< 900px)
   ========================================================================== */
@media (max-width: 899px) {
  .home-grid,
  .blog-layout,
  .article-layout,
  .briefing-bottom-grid {
    grid-template-columns: 1fr;
  }
  .toc-aside {
    display: none;
  }
  .mobile-toc-btn {
    display: inline-flex;
  }
  .blog-aside {
    position: static;
  }
}

/* ==========================================================================
   手机端适配 (< 600px Compact — DELTA §8.1 & §8.2)
   ========================================================================== */
@media (max-width: 599px) {
  .topbar-inner {
    padding: 0 12px;
  }
  .center-nav,
  .chat-pill-btn {
    display: none;
  }
  .content-main {
    padding: 14px 14px 32px;
  }
  .site-footer {
    padding: 12px 14px 28px;
  }
  .icon-btn {
    min-width: 42px;
    min-height: 42px;
  }
  .prev-next-grid {
    grid-template-columns: 1fr;
  }
  .tracker-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .briefing-hero-card {
    padding: 16px;
    border-radius: var(--radius-xl);
  }
  .briefing-item-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }
  .briefing-item-title {
    font-size: 17px;
  }
  .briefing-img-fig {
    width: calc(50% - 5px);
  }
  .briefing-img {
    width: 100%;
    height: 98px;
  }
  .briefing-insight-card,
  .briefing-priority-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }
  .briefing-meta-row {
    flex-direction: column;
    gap: 6px;
  }
  .item-actions-hover {
    opacity: 1;
    margin-left: 0;
    width: 100%;
    padding-top: 4px;
  }
  .code-copy-btn {
    opacity: 1;
  }

  /* 底部抽屉样式的弹窗 */
  .sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--outline-variant);
    margin: 4px auto 10px;
  }
  .cmdk-backdrop {
    align-items: end;
    justify-items: stretch;
    padding: 0;
  }
  .cmdk-dialog {
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 8px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: 82dvh;
  }
}
