/* ============================
   基础：全局 & 设计系统
   ============================ */

   *,
   *::before,
   *::after {
     box-sizing: border-box;
   }
   
   :root {
     /* 间距 & 圆角 */
     --radius-sm: 6px;
     --radius-md: 12px;
     --radius-lg: 18px;
   
     --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.12);
     --shadow-strong: 0 18px 40px rgba(15, 23, 42, 0.35);
   
     --content-max-width: 1120px;
   }
   
   /* 亮色主题变量 */
   body[data-theme="light"] {
     --bg-body: radial-gradient(
       circle at top left,
       #f3f7ff 0,
       #f6f7fb 35%,
       #eef2ff 100%
     );
     --bg-sidebar: radial-gradient(circle at 0 0, #0b1f4b 0, #020617 55%, #020617 100%);
     /* 下面原来的变量保持不动 */
     --bg-main-card: rgba(255, 255, 255, 0.98);
     --bg-post-card: rgba(255, 255, 255, 0.98);
     --bg-home-hero: radial-gradient(circle at 0 0, #1d4ed8 0, #0f172a 45%, #020617 100%);
     --bg-home-card: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.9));
   
     --border-subtle: rgba(148, 163, 184, 0.35);
     --border-strong: rgba(56, 189, 248, 0.6);
   
     --text-main: #0f172a;
     --text-subtle: #6b7280;
     --text-muted: #4b5563;
     --text-on-dark: #e5f0ff;
     --text-tag: #0f172a;
   
     --accent: #38bdf8;
     --accent-soft: rgba(56, 189, 248, 0.14);
     --accent-strong: #2563eb;
   
     --sidebar-border: rgba(56, 189, 248, 0.35);
     --sidebar-text: #e5f0ff;
     --sidebar-text-subtle: #c7d2fe;
   }
   
   /* 深色主题变量 */
   body[data-theme="dark"] {
     --bg-body: radial-gradient(circle at top left, #020617 0, #020617 40%, #020617 100%);
     --bg-sidebar: radial-gradient(circle at 0 0, #020617 0, #020617 55%, #020617 100%);
     --bg-main-card: rgba(15, 23, 42, 0.98);
     --bg-post-card: rgba(15, 23, 42, 0.96);
     --bg-home-hero: rgba(15, 23, 42, 0.98);
     --bg-home-card: rgba(15, 23, 42, 0.96);
   
     --border-subtle: rgba(55, 65, 81, 0.9);
     --border-strong: rgba(56, 189, 248, 0.7);
   
     --text-main: #e5e7eb;
     --text-subtle: #9ca3af;
     --text-muted: #9ca3af;
     --text-on-dark: #e5f0ff;
     --text-tag: #e5e7eb;
   
     --accent: #38bdf8;
     --accent-soft: rgba(56, 189, 248, 0.2);
     --accent-strong: #60a5fa;
   
     --sidebar-border: rgba(56, 189, 248, 0.6);
     --sidebar-text: #e5f0ff;
     --sidebar-text-subtle: #c7d2fe;
   }
   
   body {
     margin: 0;
     font-family: -apple-system, BlinkMacSystemFont, system-ui, -system-ui,
       "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
     line-height: 1.6;
     background: var(--bg-body);
     color: var(--text-main);
   }
   
   /* Layout: sidebar + main */
   .app {
     display: flex;
     min-height: 100vh;
   }
   
   /* ============================
      左侧：目录导航 Sidebar
      ============================ */
   
   .sidebar {
     width: 360px;
     background: var(--bg-sidebar);
     color: var(--sidebar-text);
     display: flex;
     flex-direction: column;
     padding: 20px 18px 14px;
     position: sticky;
     top: 0;
     height: 100vh;
     border-right: 1px solid var(--sidebar-border);
     backdrop-filter: blur(12px);
   }
   
   /* header: logo + text + motto */
   .sidebar-header {
     display: flex;
     align-items: flex-start;
     gap: 12px;
     margin-bottom: 4px;
   }
   
   .sidebar-logo {
     display: flex;
     align-items: center;
     justify-content: center;
     margin-top: 4px;
   }
   
   .sidebar-logo img {
     width: 32px;
     height: 32px;
     border-radius: 60%;
     object-fit: cover;
     display: block;
   }
   
   .sidebar-title {
     font-size: 1.25rem;
     font-weight: 600;
     letter-spacing: 0.02em;
     font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont,
       system-ui, "Segoe UI", sans-serif;
   }
   
   .sidebar-subtitle {
     margin-top: 2px;
     font-size: 0.9rem;
     color: #a5b4fc;
     font-style: italic;
   }
   
   /* motto */
   .sidebar-motto {
     margin-top: 8px;
     font-size: 0.8rem;
     color: #cbd5f5;
     line-height: 1.5;
   }
   
   .sidebar-motto div:first-child {
     font-weight: 600;
     color: #e5e7eb;
   }
   
   .sidebar-motto div + div {
     margin-top: 3px;
   }
   
   /* nav area */
   .sidebar-nav {
     flex: 1 1 auto;
     overflow-y: auto;
     padding-right: 4px;
     margin-bottom: 10px;
     font-size: 14px;
     counter-reset: group-counter;
   }
   
   /* scrollbar */
   .sidebar-nav::-webkit-scrollbar {
     width: 6px;
   }
   .sidebar-nav::-webkit-scrollbar-track {
     background: transparent;
   }
   .sidebar-nav::-webkit-scrollbar-thumb {
     background: rgba(148, 163, 184, 0.6);
     border-radius: 999px;
   }
   
   /* nav group (details) */
   .nav-group {
     margin: 4px 0;
     border-radius: 10px;
     padding: 2px 4px 4px 0;
     counter-increment: group-counter;
   }
   
   .nav-group[open] {
     background: rgba(15, 23, 42, 0.85);
   }
   
   /* HOME 分组不计数 */
   .nav-group-home {
     counter-increment: none;
     padding: 12px 18px 2px;
     margin-bottom: 10px;
     border-radius: 0;
     background: transparent;
     box-shadow: none;
     border: none;
   }
   
   /* summary 样式 */
   .nav-summary {
     list-style: none;
     cursor: pointer;
     font-size: 0.93rem;
     font-weight: 500;
     padding: 8px 10px;
     line-height: 1.4;
     outline: none;
     color: var(--sidebar-text);
     position: relative;
     font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont,
       system-ui, "Segoe UI", sans-serif;
     padding-right: 26px;
   }
   
   /* 编号：1.、2. ... */
   .nav-summary::before {
     content: counter(group-counter) ". ";
     color: #9ca3af;
     font-weight: 500;
   }
   
   /* HOME 不显示编号 */
   .nav-group-home .nav-summary::before {
     content: "";
   }
   
   /* 小三角 icon */
   .nav-summary::after {
     content: "▸";
     position: absolute;
     right: 6px;
     top: 50%;
     transform: translateY(-50%);
     font-size: 0.9rem;
     color: #93c5fd;
   }
   
   .nav-group[open] > .nav-summary::after {
     content: "▾";
   }
   
   /* 当前激活分类 */
   .nav-summary-active {
     color: var(--accent);
   }
   
   /* HOME 文本：小标题 */
   .nav-summary-home {
     display: block;
     font-weight: 700;
     line-height: 1.2;
     padding: 0;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     font-size: 0.78rem;
     color: #e5e7eb;
     text-decoration: none;
   }
   
   /* HOME 不显示编号和小三角 */
   .nav-summary-home::before,
   .nav-summary-home::after {
     content: none !important;
   }
   
   /* HOME hover */
   .nav-summary-home:hover {
     background: transparent;
     color: #bfdbfe;
   }
   
   /* 子列表 */
   .nav-list {
     list-style: none;
     padding-left: 1.4rem;
     margin: 2px 0 4px;
     counter-reset: item-counter;
   }
   
   .nav-list li {
     margin: 1px 0;
   }
   
   /* 子项链接 */
   .nav-list a {
     text-decoration: none;
     font-size: 0.9rem;
     color: var(--sidebar-text-subtle);
     position: relative;
     padding-left: 0.1rem;
     font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont,
       system-ui, "Segoe UI", sans-serif;
   }
   
   /* 1.1 / 1.2 编号 */
   .nav-list li a::before {
     counter-increment: item-counter;
     content: counter(group-counter) "." counter(item-counter) " ";
     color: #6b7280;
     margin-right: 0.1rem;
   }
   
   /* 顶部 root 导航（Today / Recent）不加编号 */
   .nav-list-root li a::before {
     content: "";
     counter-increment: none;
   }
   
   .nav-list a:hover {
     color: #e0f2fe;
   }
   
   /* HOME 下的 Today / Recent */
   .nav-list-home {
     list-style: none;
     margin: 6px 0 0;
     padding-left: 4px;
   }
   
   .nav-list-home li + li {
     margin-top: 4px;
   }
   
   .nav-list-home a {
     text-decoration: none;
     color: #c7d2fe;
     font-size: 0.86rem;
     line-height: 1.5;
   }
   
   .nav-list-home a:hover {
     color: #f9a8d4;
   }
   
   /* HOME 和下面目录之间的分割线 */
   .nav-group-divider {
     height: 1px;
     margin: 10px 0 6px;
     border-radius: 999px;
     background: linear-gradient(
       to right,
       rgba(248, 250, 252, 0.1),
       rgba(96, 165, 250, 0.9),
       rgba(15, 23, 42, 0.1)
     );
   }
   
   /* 下面普通目录 group 稍微有一点背景，不抢 HOME 的风头 */
   .nav-group:not(.nav-group-home) {
     margin: 4px 0;
     border-radius: 10px;
     padding: 2px 4px 4px 0;
   }
   
   .nav-group[open]:not(.nav-group-home) {
     background: rgba(15, 23, 42, 0.85);
   }
   
   /* 底部版权 */
   .sidebar-footer {
     font-size: 0.75rem;
     color: #9ca3af;
     border-top: 1px solid var(--sidebar-border);
     padding-top: 6px;
   }
   
   /* ============================
      右侧：主内容区
      ============================ */
   
   .main {
     flex: 1 1 auto;
     padding: 20px 24px 32px;
     display: flex;
     flex-direction: column;
     align-items: center;
   }
   
   .main-inner {
     width: 100%;
     max-width: var(--content-max-width);
   }
   
   /* 页眉 */
   .main-header {
     margin-bottom: 18px;
     border-bottom: 1px solid var(--border-subtle);
     padding-bottom: 10px;
   }
   
   /* 面包屑 + 主题按钮 */
   .breadcrumbs {
     font-size: 0.8rem;
     color: var(--text-subtle);
     margin-bottom: 4px;
     display: flex;
     align-items: center;
     gap: 6px;
   }
   
   .crumb-home {
     text-decoration: none;
     color: var(--text-subtle);
   }
   
   .crumb-home:hover {
     color: var(--accent-strong);
   }
   
   .crumb-separator {
     opacity: 0.7;
   }
   
   /* 日/夜模式按钮：最终版（略大一点，偏左下） */
   .theme-toggle {
     margin-left: auto;
     margin-right: 16px;
     margin-top: 6px;
   
     padding: 6px 14px;
     border-radius: 999px;
     border: 1px solid var(--border-subtle);
     background: var(--bg-main-card);
     cursor: pointer;
   
     display: inline-flex;
     align-items: center;
     gap: 8px;
   
     font-size: 0.85rem;
     box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
     transition:
       border-color 0.15s ease-out,
       box-shadow 0.15s ease-out,
       transform 0.1s ease-out,
       background 0.15s ease-out;
   }
   
   .theme-toggle-icon {
     font-size: 1rem;
   }
   
   .theme-toggle-label {
     font-size: 0.9rem;
     color: var(--text-subtle);
     font-weight: 800;
   }
   
   .theme-toggle:hover {
     border-color: var(--accent);
     transform: translateY(-1px);
     box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
   }
   
   /* 主标题 & 描述 */
   .main-title {
     margin: 2px 0 4px;
     font-size: 1.4rem;
   }
   
   .main-description {
     margin: 0;
     font-size: 0.9rem;
     color: var(--text-muted);
   }
   
   /* 研究标签 */
   .main-research-tags {
     margin-top: 8px;
     display: flex;
     flex-wrap: wrap;
     gap: 6px;
   }
   
   .tag {
     padding: 3px 8px;
     border-radius: 999px;
     font-size: 0.78rem;
     background: var(--accent-soft);
     border: 1px solid rgba(148, 163, 184, 0.5);
     color: var(--text-tag);
   }
   
   /* 主签名 tagline：纯文字 + 斜体 */
   .main-tagline {
     margin: 6px 0 12px;
     font-size: 0.95rem;
     font-weight: 500;
     letter-spacing: 0.015em;
     color: var(--text-muted);
     font-style: italic;
   }
   
   /* tagline 中的关键词 */
   .tag-strong {
     font-weight: 650;
     color: var(--text-main);
   }
   
   /* Share + Page views 一行 */
   .header-meta-row {
     margin-top: 10px;
     display: flex;
     align-items: center;
     justify-content: flex-start;
     gap: 24px;
     flex-wrap: wrap;
   }
   
   /* 左边 share 区 */
   .share-bar {
     margin-top: 0;
     display: flex;
     align-items: center;
     flex-wrap: nowrap;
     gap: 6px;
     font-size: 0.8rem;
   }
   
   .share-label {
     color: var(--text-subtle);
     margin-right: 4px;
   }
   
   .share-btn {
     border: none;
     outline: none;
     cursor: pointer;
     border-radius: 999px;
     padding: 4px;
     font-size: 0.78rem;
     text-decoration: none;
     display: inline-flex;
     align-items: center;
     justify-content: center;
     gap: 4px;
     transition: background 0.12s ease-out, transform 0.12s ease-out,
       box-shadow 0.12s ease-out;
     background: transparent;
   }
   
   .share-btn:hover {
     transform: translateY(-1px);
     box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
   }
   
   .share-icon {
     width: 20px;
     height: auto;
     display: block;
   }
   
   /* 复制提示 */
   .share-toast {
     margin-left: 4px;
     opacity: 0;
     transform: translateY(4px);
     transition: opacity 0.15s ease-out, transform 0.15s ease-out;
     color: var(--text-subtle);
   }
   
   .share-toast.show {
     opacity: 1;
     transform: translateY(0);
   }
   
   /* 页面浏览数：与 share 同行对齐 */
   .page-views {
     margin-top: 0;
     font-size: 0.8rem;
     color: var(--text-subtle);
   }
   
   /* ============================
      Home 区域（简洁学术版）
      ============================ */
   
   .home-section {
     margin-top: 20px;
     margin-bottom: 18px;
   }
   
   .home-intro-card {
     background: var(--bg-main-card);
     border-radius: 16px;
     padding: 18px 20px;
     border: 1px solid var(--border-subtle);
     box-shadow: var(--shadow-soft);
   }
   
   .home-intro-title {
     margin: 0 0 8px;
     font-size: 1.2rem;
   }
   
   .home-intro-text {
     margin: 4px 0;
     font-size: 0.92rem;
     color: var(--text-muted);
   }
   
   /* 左右两列 meta 信息 */
   .home-intro-meta {
     margin-top: 10px;
     padding-top: 10px;
     border-top: 1px dashed var(--border-subtle);
     display: grid;
     grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
     gap: 8px 80px;
   }
   
   .home-intro-meta-item {
     font-size: 0.85rem;
   }
   
   .meta-label {
     display: block;
     font-size: 0.78rem;
     text-transform: uppercase;
     letter-spacing: 0.08em;
     color: var(--text-subtle);
     margin-bottom: 2px;
   }
   
   .meta-value {
     color: var(--text-main);
   }
   
   /* Home 底部外链区域 */
   .home-links {
     margin-top: 14px;
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
   }
   
   /* 小而精致的学术按钮 */
   .home-link-btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
   
     padding: 4px 14px;
     border-radius: 999px;
     border: 1px solid rgba(96, 165, 250, 0.9);
     background: rgba(255, 255, 255, 0.95);
     color: #0f172a;
   
     font-size: 0.8rem;
     font-weight: 500;
     text-decoration: none;
     letter-spacing: 0.01em;
   
     box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
     transition:
       background 0.15s ease-out,
       box-shadow 0.15s ease-out,
       transform 0.1s ease-out,
       border-color 0.15s ease-out;
   }
   
   .home-link-btn:hover {
     background: rgba(219, 234, 254, 0.9);
     border-color: rgba(59, 130, 246, 1);
     transform: translateY(-1px);
     box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
   }
   
   .home-link-text {
     font-size: 0.82rem;
     color: var(--accent-strong);
     text-decoration: none;
   }
   
   .home-link-text:hover {
     text-decoration: underline;
   }
   
   /* 小屏时 meta 一列排布 */
   @media (max-width: 900px) {
     .home-intro-meta {
       grid-template-columns: minmax(0, 1fr);
     }
   }
   
   /* ============================
      Post 列表
      ============================ */
   
   .post-list-section {
     margin-top: 20px;
   }
   
   .section-title {
     margin: 4px 0 10px;
     font-size: 1.05rem;
   }
   
   .post-card {
     background: var(--bg-post-card);
     border-radius: 14px;
     padding: 14px 16px;
     margin-bottom: 12px;
     box-shadow: var(--shadow-soft);
     border: 1px solid var(--border-subtle);
     transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
       border-color 0.12s ease-out, background 0.12s ease-out;
   }
   
   .post-card:hover {
     transform: translateY(-2px);
     box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
     border-color: var(--accent);
   }
   
   .post-card-title {
     font-size: 1rem;
     font-weight: 600;
     text-decoration: none;
     color: var(--text-main);
   }
   
   .post-card-title:hover {
     color: var(--accent-strong);
   }
   
   .post-card-meta {
     margin: 4px 0;
     font-size: 0.8rem;
     color: var(--text-subtle);
   }
   
   .post-card-excerpt {
     margin: 6px 0 0;
     font-size: 0.88rem;
     color: var(--text-muted);
   }
   
   /* ============================
      iframe 内容阅读区
      ============================ */
   
   .content-viewer {
     margin-top: 24px;
     /* 如果你想默认隐藏，在这里加：
        display: none;
     */
   }
   
   .content-viewer iframe {
     width: 100%;
     min-height: calc(100vh - 220px);
     border: none;
     border-radius: 16px;
     box-shadow: var(--shadow-soft);
     background: var(--bg-main-card);
   }
   
   /* ============================
      单篇 Note 页面复用样式
      ============================ */
   
   .site-header {
     background: rgba(15, 23, 42, 0.9);
     backdrop-filter: blur(10px);
     border-bottom: 1px solid var(--border-subtle);
     position: sticky;
     top: 0;
     z-index: 10;
   }
   
   .site-header-inner {
     max-width: var(--content-max-width);
     margin: 0 auto;
     padding: 10px 16px;
     display: flex;
     flex-direction: column;
     gap: 2px;
   }
   
   .site-title {
     margin: 0;
     font-size: 1.1rem;
   }
   
   .site-title a {
     text-decoration: none;
     color: var(--text-on-dark);
   }
   
   .site-subtitle {
     margin: 0;
     font-size: 0.8rem;
     color: #9ca3af;
   }
   
   /* TOC 布局 */
   .layout-with-toc {
     max-width: var(--content-max-width);
     margin: 16px auto 32px;
     padding: 0 16px;
     display: flex;
     gap: 16px;
   }
   
   .toc {
     flex: 0 0 220px;
     position: sticky;
     top: 72px;
     align-self: flex-start;
   }
   
   .toc-inner {
     background: var(--bg-main-card);
     border-radius: 12px;
     padding: 10px 12px;
     box-shadow: var(--shadow-soft);
     border: 1px solid var(--border-subtle);
     max-height: calc(100vh - 90px);
     overflow-y: auto;
   }
   
   .toc-title {
     margin: 0 0 6px;
     font-size: 0.95rem;
     border-bottom: 1px solid rgba(229, 231, 235, 0.5);
     padding-bottom: 4px;
   }
   
   .toc-list {
     list-style: none;
     margin: 0;
     padding: 0;
     font-size: 0.85rem;
   }
   
   .toc-item {
     margin: 3px 0;
   }
   
   .toc-item-sub {
     margin-left: 12px;
     font-size: 0.82rem;
   }
   
   .toc a {
     text-decoration: none;
     color: var(--text-muted);
   }
   
   .toc a:hover {
     color: var(--accent-strong);
   }
   
   .content {
     flex: 1 1 auto;
   }
   
   .post {
     background: var(--bg-main-card);
     border-radius: 14px;
     padding: 18px 20px;
     box-shadow: var(--shadow-soft);
     border: 1px solid var(--border-subtle);
   }
   
   .post-header {
     border-bottom: 1px solid rgba(229, 231, 235, 0.5);
     margin-bottom: 14px;
     padding-bottom: 8px;
   }
   
   .post-title {
     margin: 0 0 6px;
     font-size: 1.3rem;
   }
   
   .post-meta {
     margin: 0 0 6px;
     font-size: 0.8rem;
     color: var(--text-subtle);
   }
   
   /* ============================
      右下角回到顶部按钮
      ============================ */
   
   .back-to-top {
     position: fixed;
     right: 24px;
     bottom: 24px;
     z-index: 50;
   
     padding: 6px 14px;
     border-radius: 999px;
     border: 1px solid var(--border-subtle);
     background: var(--bg-main-card);
     color: var(--text-muted);
     font-size: 0.8rem;
     cursor: pointer;
   
     box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
     opacity: 0;
     transform: translateY(8px);
     pointer-events: none;
     transition:
       opacity 0.15s ease-out,
       transform 0.15s ease-out,
       box-shadow 0.15s ease-out,
       background 0.15s ease-out;
   }
   
   .back-to-top:hover {
     box-shadow: 0 16px 32px rgba(15, 23, 42, 0.3);
     border-color: var(--accent);
   }
   
   /* 显示状态 */
   .back-to-top.show {
     opacity: 1;
     transform: translateY(0);
     pointer-events: auto;
   }
   
   /* ============================
      响应式
      ============================ */
   
   @media (max-width: 900px) {
     .app {
       flex-direction: column;
     }
   
     .sidebar {
       width: 100%;
       position: static;
       max-height: none;
       height: auto;
       border-right: none;
       border-bottom: 1px solid var(--sidebar-border);
     }
   
     .main {
       padding: 16px 12px 24px;
     }
   
     .main-inner {
       max-width: 100%;
     }
   
     .layout-with-toc {
       flex-direction: column;
     }
   
     .toc {
       position: static;
       flex: 1 1 auto;
     }
   
     .toc-inner {
       max-height: none;
     }
   
     .theme-toggle span {
       display: none; /* 小屏幕只显示图标（如果有文字 span） */
     }
   }
   
   @media (max-width: 600px) {
     .back-to-top {
       right: 16px;
       bottom: 16px;
     }
   }
   