/* ==========================================================================
   2026 Modern Premium Minimalist Blog Core Style (100% Native, No Library)
   ========================================================================== */

/* -------------------------------------------------------------
 * 1. 现代高级感设计语言（Design Tokens）
 * ------------------------------------------------------------- */
:root {
    /* 字体族：优先调用现代数字屏幕高定西文 Inter，再无缝衔接苹方等高级中文字体 */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    
    /* 色彩哲学：引入高级冷灰白与更有分量的浅黑，大幅缓解长文视觉疲劳 */
    --bg-main: #f8f9fa;          /* 杂志级冷灰白底 */
    --bg-card: #f1f3f5;          /* 模块卡片浅灰 */
    --text-main: #111112;        /* 苹果官网同款稳重深黑 */
    --text-muted: #6e6e73;       /* 减淡的次要文本灰 */
    --primary: #ff6b6b;          /* LOGO色 */
    --accent: #0066cc;           /* 克制的高级星空蓝 */
    --border-light: #e9ecef;     /* 极淡的分割线 */
    
    /* 黄金阅读版心宽度：严格死守中英文最舒适的单行视线扫描跨度 */
    --article-width: 720px; 
}

/* 布局主包裹容器：单栏 720px 绝对居中版心 */
.page-wrapper {
    position: relative;          /* 作为左侧目录绝对/粘性定位的坐标基准点 */
    max-width: var(--article-width);            
    margin: 0 auto 120px auto;
    padding: 0 12px;
}

/* 右侧正文及外围功能核心容器 */
.article-container {
    width: 100%;
}

/* -------------------------------------------------------------
 * 2. 顶部导航与首屏美学 (Header)
 * ------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    list-style: none;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 60px;
    margin-bottom: 24px;
}
.breadcrumb li:not(:last-child)::after { content: "·"; margin-left: 8px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--text-main); }

.post-header { margin-bottom: 40px; }
.post-title {
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.8px;
    color: var(--text-main);
    margin-bottom: 20px;
}
.meta-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.author-name { font-weight: 500; color: var(--text-main); }

/* 观点提炼，GEO极致抓取区 */
.tldr {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 40px;
}
.tldr-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    color: var(--text-main);
}
.tldr ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
}
.tldr ul li { position: relative; padding-left: 20px; }
.tldr ul li::before { content: "— "; position: absolute; left: 0; color: #ccced3; }

/* -------------------------------------------------------------
 * 3. 知乎同款：外延坐标悬浮 + 智能吸顶目录 (Sticky Sidebar)
 * ------------------------------------------------------------- */
.zhihoo-sidebar {
    position: sticky;            /* 滚动到顶部自动固定 */
    top: 100px;                  
    float: left;                 /* 完美的流式浮动，100% 零占用正文 DOM 空间 */
    width: 200px;
    height: auto;
    /* 核心几何偏移：向左偏移目录自身（200px） + 黄金呼吸间距（50px） */
    margin-left: -250px; 
    z-index: 100;
}
.sidebar-sticky-box {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;     /* 标题过长时自动打上省略号，死守宽度边界 */
}
.sidebar-toc-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.sidebar-toc-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 1px solid var(--border-light);
    padding-left: 0;
}
.sidebar-toc-nav li { position: relative; }
.sidebar-toc-nav a {
    display: block;
    font-size: 14px;
    color: #86868b;
    text-decoration: none;
    line-height: 1.4;
    padding-left: 16px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    transition: all 0.25s ease;
}
.sidebar-toc-nav a:hover { color: var(--text-main); }
/* 滚动高亮核心状态：由 JS 动态注入 */
.sidebar-toc-nav a.active {
    color: var(--accent);
    font-weight: 600;
    border-left-color: var(--accent); /* 激活左侧流线能量条 */
}

/* -------------------------------------------------------------
 * 4. 纯净文章正文排盒（零 Class 依赖，100% 纯原生标签匹配）
 * ------------------------------------------------------------- */
.post-content {
    font-size: 18px; 
    line-height: 1.72;         /* 压缩至 1.72，完美兼顾中英文双语视觉群落的凝聚力 */
    color: #33373b;
    letter-spacing: -0.1px;    /* 微调字距，消除英文行尾毛刺 */
}
.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 52px;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}
.post-content h2 { font-size: 25px; border-bottom: 1px solid var(--border-light); padding-bottom: 8px; }
.post-content h3 { font-size: 20px; margin-top: 36px; margin-bottom: 14px; }

.post-content p {
    text-indent: 0;
    margin-bottom: 1.4em;
    text-align: left; 
    overflow-wrap: break-word;
}
.post-content p:empty { display: none; }
.post-content strong { color: var(--text-main); font-weight: 700; }

/* 列表与引用 */
.post-content ul, .post-content ol, .post-content dl{
	margin: 15px;
	line-height:1.8em;
}
.post-content p+ul, .post-content p+ol, .post-content p+dl{
	margin-top: 0px;
}
.post-content ul>li{
	position: relative;
	margin-left:20px;
	margin-bottom:10px;
	list-style-type: disc;
    list-style-position: outside;
    list-style-image: none;
}
.post-content ul>li::before {
    content: "";
    position: absolute;
    border-left: .5px solid #dfe0e1;
    left: -16px;
    height: calc(100% - 35px);
    top: 35px;
    transform: translateX(-1px);
}
.post-content ol>li{
	margin-left:20px;
	margin-bottom:10px;
	line-height:1.8em;
	list-style-type: decimal;
    list-style-position: outside;
    list-style-image: none;
}
.post-content ul>li ol>li {
    margin-left: 0;
	list-style-type: none;
}
.post-content dl dd{
	margin-left:20px;
	margin-bottom:10px;
	line-height:1.8em;
	list-style-type: square;
    list-style-position: outside;
    list-style-image: none;
}
.post-content blockquote {
    margin:15px 0px;
	padding:15px;
    color: #555;
    line-height: 1.4;
    border-left: .25em solid #3498db;
    background-color: #f1f1f1;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

/* 代码块与图片：死守 720px 版心绝对齐边对齐 */
.post-content pre {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    width: 100%;
    margin: 32px 0;
}
.post-content pre code { font-family: Menlo, Monaco, Consolas, monospace; font-size: 14px; background: none; padding: 0; }

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px auto;
    display: block;
    cursor: zoom-in;           /* 鼠标变为放大镜提示 */
    transition: transform 0.2s ease;
}
.post-content img:hover { transform: scale(1.01); }

/* 行内链接 ([文本](url) 还原) */
.post-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
    transition: color 0.2s, border-color 0.25s ease;
}
.post-content a:hover { 
    color: var(--primary); 
    border-bottom: 1px dashed var(--primary);; 
}

/* ==========================================================================
   文章页高级表格样式（杂志级极简风）
   ========================================================================== */
.post-content table {
    margin-bottom: 15px;
    width: 100%;
    max-width: var(--article-width);
    border-collapse: collapse;    
    text-align: left;             
    font-size: 0.95em;           
    line-height: 1.5;
    color: var(--text-main);
    overflow-x: auto;
}
.post-content table th {
    font-weight: 600;               /* 适度加粗，配合 Inter 字体非常高级 */
    color: var(--text-main);
    padding: 14px 16px;             /* 舒适的内边距 */
    background-color: var(--bg-card); /* 融入大背景，保持轻盈 */
    background-color: rgba(0, 102, 204, 0.05);
    border: 1px solid #d1d5db; 
    border-bottom: 2px solid #d1d5db; 
    letter-spacing: -0.01em; 
}
.post-content table td {
    padding: 14px 16px;
    font-variant-numeric: tabular-nums; /* 关键：强制数字等宽，让多行数字对齐时极为整齐 */
    border: 1px solid var(--border-light); /* #e9ecef */
    transition: background-color 0.2s ease;
}
.post-content table tbody tr:hover td {
    background-color: var(--bg-card); /* #eceef0 */
}

/* 参考文献区（权威 E-E-A-T 落地） */
.post-footer { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border-light); }
.post-footer h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 16px; }
.post-footer ol { padding-left: 20px; font-size: 14.5px; color: var(--text-muted); line-height: 1.6; display: flex; flex-direction: column; gap: 8px; }
.post-footer ol li{ list-style: decimal; }
.post-footer ol a { color: #495057; text-decoration: none; border-bottom: 1px dashed #ced4da; transition: all 0.2s; }
.post-footer ol a:hover { color: var(--accent); border-bottom-style: solid; border-bottom-color: var(--accent); }


/* -------------------------------------------------------------
 * 5. 文章底部新功能区 (Footer & Navigation)
 * ------------------------------------------------------------- */
/* 5.1 标签集 */
.post-tags { display: flex; gap: 8px; margin-top: 40px; margin-bottom: 40px;flex-wrap: wrap; }
.tag-item {
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg-card);
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}
.tag-item:hover { background-color: #e8e8ed; color: var(--text-main); }

/* 5.2 FAQ 原生折叠面板（回归传统习惯：紧贴正文与标签之后） */
.post-faq-section { margin-top: 60px; margin-bottom: 48px; }
.faq-title { font-size: 20px; font-weight: 600; color: var(--text-main); }
.faq-accordion { border-bottom: 1px solid var(--border-light); padding: 16px 0; }
.faq-question::-webkit-details-marker, .faq-question::marker { display: none; } /* 隐去丑陋黑三角 */
.faq-question { font-size: 16px; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; user-select: none; color: var(--text-main); }
.faq-question::after { content: "+"; font-size: 18px; color: var(--text-muted); font-weight: 300; transition: transform 0.3s; }
.faq-accordion[open] .faq-question::after { transform: rotate(45deg); color: var(--text-main); } /* 旋转45°变大叉，极佳微交互 */
.faq-answer { padding-top: 10px; font-size: 15px; color: var(--text-muted); line-height: 1.6; }

/* 5.3 翻页导航网格（死守双栏对称美） */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 32px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 64px;
    color: var(--text-muted);
}
.nav-card { 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    padding: 16px; 
    border-radius: 8px;
    background-color: var(--bg-card); 
    transition: all 0.2s ease-in-out;
}
.nav-card.prev{
    border-left: 3px solid var(--bg-card);
}
.nav-card.next{
    border-right: 3px solid var(--bg-card);
}
.nav-card.prev:hover { 
    transform: translateX(-2px); 
    background-color: #f3f5f7;
    border-left: 3px solid var(--accent);
}
.nav-card.next:hover { 
    transform: translateX(2px); 
    background-color: #f3f5f7;
    border-right: 3px solid var(--accent);
}
.nav-card.next { text-align: right; }
.nav-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; font-weight: 500; }
.nav-title { font-size: 15.5px; font-weight: 600; color: var(--text-main); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.nav-card:hover .nav-title { color: var(--accent); }

/* 5.4 参考文献区（权威 E-E-A-T 落地） */
.post-sources { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border-light); }
.post-sources h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 16px; }
.post-sources ol { padding-left: 20px; font-size: 14.5px; color: var(--text-muted); line-height: 1.6; display: flex; flex-direction: column; gap: 8px; }
.post-sources ol a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed #ced4da; transition: all 0.2s; }
.post-sources ol a:hover { color: var(--accent); border-bottom-style: solid; border-bottom-color: var(--accent); }
/* 5.5 流式延伸阅读卡片 */
.related-section { margin-top: 56px; }
.related-title { font-size: 18px; font-weight: 600; margin-bottom: 24px; color: var(--text-main); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.related-img-placeholder { width: 100%; aspect-ratio: 16/10; background-color: var(--bg-card); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #ccc; }
.related-post-title { font-size: 14px; font-weight: 600; color: var(--text-main); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card:hover .related-post-title { color: var(--accent); }


/* ==========================================================================
   右侧微型悬浮工具栏 (Sticky Action Bar - Right Side)
   ========================================================================== */
.sidebar-right-actions {
    position: fixed;
    /* 核心几何定位：
       以父级容器中心点（50%）为基准，往右推正文的一半（360px），再加 40px 黄金呼吸间距
    */
    left: calc(50% + (720px / 2) + 40px);
    top: 50%;
    transform: translateY(-50%); /* 垂直居中 */
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 99;
}
.action-right-item {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
}
.action-right-item:hover {
    color: var(--text-main);
    border-color: #b0b0b5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}
.action-right-item svg { width: 18px; height: 18px; }
.action-right-item.liked {
    color: #e11d48; /* 高级玫瑰红 */
    border-color: #fca5a5;
    background-color: #fff5f5;
}
.like-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px; 
  background-color: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px; 
  text-align: center;
  border-radius: 9px;
  box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 36px;
}
/* 当没有点赞时隐藏徽章 */
.like-badge.hidden {
  display: none;
}

/* 响应式断点：当浏览器宽度不足以放下右侧悬浮栏时，优雅隐藏，绝不挤压正文 */
@media (max-width: 1120px) {
    .sidebar-right-actions { display: none; }
}

/* ==========================================================================
   数据驱动：高级感全屏微透分享弹窗 (Modal Container)
   ========================================================================== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(252, 252, 252, 0.8); /* 极高透明底色 */
    backdrop-filter: blur(12px);                /* 苹果级高定毛玻璃虚化 */
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.share-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.share-modal-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.share-modal-overlay.active .share-modal-card {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.share-modal-header h3 { font-size: 18px; font-weight: 600; color: var(--text-main); }
.share-close-btn {
    background: none; border: none; cursor: pointer; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    padding: 4px; border-radius: 50%; transition: background-color 0.2s;
}
.share-close-btn:hover { background-color: var(--bg-card); color: var(--text-main); }
.share-platforms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列出版物网格 */
    gap: 16px;
}

.share-platform-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    background-color: var(--bg-main);
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
/* 鼠标滑过对应的分享按钮时颜色微调 */
.share-platform-link:hover {
    background-color: var(--bg-card);
    transform: translateY(-1px);
}
.share-platform-link svg {
    width: 24px;
    height: 24px;
}

/*==========================================================================
	6. 原生高定白透图片放大查看遮罩 (Lightbox Overlay)
========================================================================== */
.img-overlay {
position: fixed;
top: 0; left: 0; width: 100%; height: 100%;
background-color: rgba(252, 252, 252, 0.98); / 苹果级微透白底，极为通透 */
z-index: 9999;
display: flex; align-items: center; justify-content: center;
opacity: 0; pointer-events: none;
transition: opacity 0.3s ease;
cursor: zoom-out;
}
.img-overlay.active { opacity: 1; pointer-events: auto; }
.img-overlay img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); transform: scale(0.95); transition: transform 0.3s ease; }
.img-overlay.active img { transform: scale(1); }
/*========================================================================== 
	7. 阶梯式响应式防挤压断点控制 (Responsive Design)
========================================================================== */
/* 断点一：当浏览器总宽度低于 1220px 时（屏幕边缘开始碰触 200px 目录了） */
@media (max-width: 1220px) {
.zhihoo-sidebar {
float: none;
position: absolute;
left: 20px; right: auto; margin-left: 0; top: 240px;
opacity: 0.15;
transition: all 0.3s ease;
}
.zhihoo-sidebar:hover {
opacity: 1;
background: rgba(252, 252, 252, 0.98);
padding: 16px; border-radius: 12px;
box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}
}
/* 断点二：平板及手机端（低于860px），彻底剥离侧边目录，死守 100% 纯净阅读区 */
@media (max-width: 860px) {
.page-wrapper { padding: 0 16px; }
.zhihoo-sidebar { display: none; }
.breadcrumb { margin-top: 32px; }
.post-title { font-size: 28px; }
.post-content { font-size: 17px; line-height: 1.75; }
.post-navigation { grid-template-columns: 1fr; gap: 20px; padding: 24px 0; }
.post-navigation .next { text-align: left; }
.related-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   1. 正文图片与代码块对齐，拒绝任何破框
   ========================================================================== */
.post-content pre {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    width: 100%;
    margin: 32px 0;
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.post-content img:hover {
    transform: scale(1.01);
}

/* ==========================================================================
   2. 纯原生高级感大图查看遮罩（Lightbox Overlay）
   ========================================================================== */
.img-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(252, 252, 252, 0.98); /* 苹果同款高定微透白底，比死板的黑底高级太多 */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: zoom-out; 
}
.img-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.img-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); 
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.img-overlay.active img {
    transform: scale(1);
}