/* ============================================================
   出海168 博客页样式 (posts.css)
   复用设计系统令牌：品牌红 #F1404B、5色标签、卡片样式、暗色模式
   覆盖范围：列表页 / 文章详情页 / taxonomy / terms
   ============================================================ */

/* ============================================================
   一、字号体系（中文阅读优化，重新设计层级）
   ------------------------------------------------------------ */
/* 旧：H1 24 / H2 20 / H3 18 / 正文 14，层级模糊、行高偏紧
   新：H1 30 / H2 24 / H3 20 / H4 17 / 正文 16，行高 1.8，层级清晰 */

.posts-article .content {
    font-size: 16px;
    line-height: 1.8;
    color: #1D232B;
}
.posts-article .content p {
    margin: 16px 0;
}
.posts-article .content > p:first-of-type {
    margin-top: 20px;
}

/* H1 文章主标题 */
.posts-article h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
    color: #282A2D;
    margin: 8px 0 14px;
    letter-spacing: -0.01em;
}

/* H2 区块标题：左 4px 品牌红线 */
.posts-article .content h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.35;
    color: #282A2D;
    margin: 36px 0 16px;
    padding-left: 14px;
    border-left: 4px solid #F1404B;
}

/* H3 子标题：左 3px 品牌红线 */
.posts-article .content h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #282A2D;
    margin: 28px 0 12px;
    padding-left: 12px;
    border-left: 3px solid #F1404B;
}

/* H4 小节标题：底部细线 */
.posts-article .content h4 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: #282A2D;
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(136, 136, 136, .2);
}

.posts-article .content h5,
.posts-article .content h6 {
    font-size: 15px;
    font-weight: 600;
    color: #282A2D;
    margin: 18px 0 8px;
}

/* 导语/摘要（文章页 description） */
.posts-lead {
    font-size: 17px;
    line-height: 1.7;
    color: #555;
    margin: 16px 0 28px;
    padding: 16px 20px;
    background: #F9F9F9;
    border-left: 3px solid #F1404B;
    border-radius: 0 5px 5px 0;
}

/* 元信息条 */
.posts-meta {
    font-size: 13px;
    color: #6C757D;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}
.posts-meta i {
    margin-right: 5px;
    color: #adb5bd;
}
.posts-meta .badge-category {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(60deg, #f1404b, #f1417c);
}

/* 链接 */
.posts-article .content a {
    color: #007BFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
}
.posts-article .content a:hover {
    color: #F1404B;
    border-bottom-color: #F1404B;
}

/* 引用 blockquote */
.posts-article .content blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    background: rgba(241, 64, 75, .06);
    border-left: 4px solid #F1404B;
    border-radius: 0 5px 5px 0;
    color: #555;
}
.posts-article .content blockquote p {
    margin: 6px 0;
}

/* 内联代码 + 代码块 */
.posts-article .content code {
    font-size: 14px;
    padding: 2px 6px;
    margin: 0 2px;
    background: #f5f5f5;
    color: #F1404B;
    border-radius: 3px;
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}
.posts-article .content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.5;
}
.posts-article .content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

/* 图片 */
.posts-article .content img {
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    display: block;
    margin: 20px auto;
    max-width: 100%;
    height: auto;
}

/* 列表 */
.posts-article .content ul,
.posts-article .content ol {
    padding-left: 1.6em;
    margin: 16px 0;
}
.posts-article .content li {
    margin: 6px 0;
    line-height: 1.8;
}

/* 表格 */
.posts-article .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 5px;
    overflow: hidden;
}
.posts-article .content th,
.posts-article .content td {
    padding: 10px 14px;
    border: 1px solid #e9ecef;
    text-align: left;
}
.posts-article .content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #282A2D;
}
.posts-article .content tbody tr:nth-child(even) {
    background: #fafafa;
}
.posts-article .content tbody tr:hover {
    background: rgba(241, 64, 75, .04);
}

/* 分隔线 */
.posts-article .content hr {
    border: none;
    height: 1px;
    background: #e9ecef;
    margin: 32px 0;
}

/* ============================================================
   二、列表页：卡片网格
   ------------------------------------------------------------ */

/* Hero 区 */
.posts-hero {
    background: linear-gradient(135deg, rgba(241, 64, 75, .06), rgba(241, 65, 124, .06));
    border-radius: 8px;
    padding: 24px 28px;
    margin: 16px 0 24px;
    border: 1px solid rgba(241, 64, 75, .08);
}
.posts-hero h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #282A2D;
}
.posts-hero p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}
.posts-hero .count-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 12px;
    background: linear-gradient(60deg, #f1404b, #f1417c);
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
}

/* 分类筛选条 */
.posts-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.posts-filter a {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e9ecef;
    color: #495057;
    text-decoration: none;
    transition: all .2s;
}
.posts-filter a:hover,
.posts-filter a.active {
    background: #F1404B;
    border-color: #F1404B;
    color: #fff;
}

/* 卡片网格 */
.posts-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 767px) {
    .posts-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1400px) {
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 单张文章卡 */
.posts-card {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 20px -5px rgba(158, 158, 158, .2);
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    flex-direction: column;
}
.posts-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 40px -24px rgba(0, 36, 100, .3);
}

/* 卡片封面 16:9 */
.posts-card-cover {
    position: relative;
    display: block;
    padding-top: 56.25%;
    overflow: hidden;
    background: linear-gradient(135deg, #f1404b 0%, #f1417c 100%);
    text-decoration: none;
}
.posts-card-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.posts-card:hover .posts-card-cover img {
    transform: scale(1.06);
}
.posts-card-cover .cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .55);
    font-size: 52px;
    font-weight: 700;
}

/* 卡片正文 */
.posts-card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.posts-card-meta {
    font-size: 12px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.posts-card-meta .cat {
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: #F1404B;
}
.posts-card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: #282A2D;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.posts-card-title a {
    color: inherit;
    text-decoration: none;
}
.posts-card-title a:hover {
    color: #F1404B;
}
.posts-card-excerpt {
    font-size: 13px;
    line-height: 1.65;
    color: #6c757d;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.posts-card-foot {
    margin-top: auto;
    font-size: 12px;
    color: #adb5bd;
    display: flex;
    gap: 14px;
}
.posts-card-foot i {
    margin-right: 4px;
}

/* ============================================================
   三、侧栏组件
   ------------------------------------------------------------ */
.posts-sidebar-card {
    background: #fff;
    border-radius: 5px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 0 20px -5px rgba(158, 158, 158, .2);
}
.posts-sidebar-card > h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #F1404B;
    color: #282A2D;
    display: flex;
    align-items: center;
    gap: 6px;
}
.posts-sidebar-card > h4 i {
    color: #F1404B;
}

/* 标签云 */
.posts-tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.posts-tagcloud a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 13px;
    background: #f9f9f9;
    border: 1px solid #e9ecef;
    color: #F1404B;
    text-decoration: none;
    transition: all .2s;
    line-height: 1.5;
}
.posts-tagcloud a:hover {
    background: #F1404B;
    color: #fff;
    border-color: #F1404B;
}
.posts-tagcloud a .count {
    color: #adb5bd;
    font-size: .85em;
    margin-left: 2px;
}
.posts-tagcloud a:hover .count {
    color: rgba(255, 255, 255, .8);
}

/* TOC 目录 */
.posts-toc-wrap {
    position: sticky;
    top: 80px;
}
.posts-toc-wrap > h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #F1404B;
    color: #282A2D;
    display: flex;
    align-items: center;
    gap: 6px;
}
.posts-toc-wrap > h4 i { color: #F1404B; }
#TableOfContents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
#TableOfContents ul ul {
    padding-left: 14px;
    margin-top: 2px;
}
#TableOfContents li {
    margin: 2px 0;
}
#TableOfContents a {
    display: block;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #6c757d;
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 3px 3px 0;
    transition: all .2s;
}
#TableOfContents a:hover {
    color: #F1404B;
    background: rgba(241, 64, 75, .05);
}
#TableOfContents a.active {
    color: #F1404B;
    border-left-color: #F1404B;
    background: rgba(241, 64, 75, .06);
    font-weight: 500;
}

/* ============================================================
   四、文章页底部组件
   ------------------------------------------------------------ */

/* 版权声明 */
.posts-copyright {
    margin: 32px 0 8px;
    padding: 14px 18px;
    background: #f9f9f9;
    border-radius: 5px;
    font-size: 13px;
    color: #6c757d;
    border-left: 3px solid #F1404B;
    line-height: 1.7;
}
.posts-copyright a {
    color: #F1404B;
    text-decoration: none;
}
.posts-copyright strong {
    color: #282A2D;
}

/* 上下篇导航卡片 */
.posts-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 28px 0;
}
@media (max-width: 575px) {
    .posts-nav { grid-template-columns: 1fr; }
}
.posts-nav-card {
    display: block;
    padding: 14px 16px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    transition: all .2s;
}
.posts-nav-card:hover {
    border-color: #F1404B;
    box-shadow: 0 6px 16px rgba(241, 64, 75, .12);
    transform: translateY(-2px);
}
.posts-nav-card .label {
    font-size: 11px;
    color: #adb5bd;
    margin-bottom: 5px;
}
.posts-nav-card .title {
    font-size: 14px;
    font-weight: 500;
    color: #282A2D;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.posts-nav-card.next {
    text-align: right;
}
.posts-nav-placeholder {
    display: block;
}

/* 相关文章标题 */
.posts-related-title {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: #282A2D;
    padding-left: 12px;
    border-left: 3px solid #F1404B;
}

/* 相关文章卡片网格 */
.posts-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}
@media (max-width: 767px) {
    .posts-related-grid { grid-template-columns: 1fr; }
}
.posts-related-card {
    display: block;
    background: #fff;
    border-radius: 5px;
    padding: 14px 16px;
    box-shadow: 0 0 20px -5px rgba(158, 158, 158, .2);
    transition: transform .3s, box-shadow .3s;
    text-decoration: none;
    color: inherit;
}
.posts-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -20px rgba(0, 36, 100, .3);
}
.posts-related-card .date {
    font-size: 11px;
    color: #adb5bd;
}
.posts-related-card .title {
    font-size: 14px;
    font-weight: 500;
    color: #282A2D;
    margin-top: 5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   五、terms 索引页样式
   ------------------------------------------------------------ */
.posts-terms-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 0 40px;
}

/* ============================================================
   六、暗色模式适配
   ------------------------------------------------------------ */
.io-black-mode .posts-card,
.io-black-mode .posts-sidebar-card,
.io-black-mode .posts-related-card,
.io-black-mode .posts-nav-card {
    background: #2C2E2F;
    box-shadow: 0 0 20px -5px rgba(0, 0, 0, .3);
}
.io-black-mode .posts-card-title,
.io-black-mode .posts-related-card .title,
.io-black-mode .posts-nav-card .title,
.io-black-mode .posts-related-title {
    color: #C6C9CF;
}
.io-black-mode .posts-card-excerpt,
.io-black-mode .posts-card-foot {
    color: #888;
}
.io-black-mode .posts-card-meta {
    color: #666;
}
.io-black-mode .posts-card-meta .cat {
    background: #F1404B;
}
.io-black-mode .posts-hero {
    background: linear-gradient(135deg, rgba(241, 64, 75, .12), rgba(241, 65, 124, .12));
    border-color: rgba(241, 64, 75, .15);
}
.io-black-mode .posts-hero h1 {
    color: #C6C9CF;
}
.io-black-mode .posts-hero p {
    color: #888;
}
.io-black-mode .posts-filter a {
    background: #363738;
    border-color: #3d4044;
    color: #C6C9CF;
}
.io-black-mode .posts-filter a:hover,
.io-black-mode .posts-filter a.active {
    background: #F1404B;
    border-color: #F1404B;
    color: #fff;
}
.io-black-mode .posts-tagcloud a {
    background: #363738;
    border-color: #3d4044;
    color: #ff8a90;
}
.io-black-mode .posts-tagcloud a:hover {
    background: #F1404B;
    color: #fff;
}
.io-black-mode .posts-toc-wrap > h4,
.io-black-mode .posts-sidebar-card > h4 {
    color: #C6C9CF;
}
.io-black-mode #TableOfContents a {
    color: #888;
}
.io-black-mode #TableOfContents a:hover,
.io-black-mode #TableOfContents a.active {
    color: #ff8a90;
    background: rgba(241, 64, 75, .1);
}
.io-black-mode .posts-article .content {
    color: #BBB;
}
.io-black-mode .posts-article h1,
.io-black-mode .posts-article .content h2,
.io-black-mode .posts-article .content h3,
.io-black-mode .posts-article .content h4,
.io-black-mode .posts-article .content h5,
.io-black-mode .posts-article .content h6 {
    color: #C6C9CF;
}
.io-black-mode .posts-article .content a {
    color: #4da3ff;
}
.io-black-mode .posts-article .content a:hover {
    color: #ff8a90;
}
.io-black-mode .posts-article .content code {
    background: #363738;
    color: #ff8a90;
}
.io-black-mode .posts-article .content blockquote {
    background: rgba(241, 64, 75, .1);
    color: #aaa;
}
.io-black-mode .posts-article .content th {
    background: #363738;
    color: #C6C9CF;
}
.io-black-mode .posts-article .content tbody tr:nth-child(even) {
    background: #232527;
}
.io-black-mode .posts-article .content tbody tr:hover {
    background: rgba(241, 64, 75, .08);
}
.io-black-mode .posts-article .content table th,
.io-black-mode .posts-article .content table td {
    border-color: #3d4044;
}
.io-black-mode .posts-copyright {
    background: #232527;
    color: #888;
    border-left-color: #F1404B;
}
.io-black-mode .posts-copyright strong {
    color: #C6C9CF;
}
.io-black-mode .posts-lead {
    background: #232527;
    color: #999;
}
.io-black-mode .posts-meta {
    border-bottom-color: #3d4044;
    color: #888;
}
.io-black-mode .posts-meta i {
    color: #666;
}
.io-black-mode .posts-nav-card {
    border-color: #3d4044;
}
.io-black-mode .posts-nav-card .label {
    color: #666;
}
.io-black-mode .posts-article .content hr {
    background: #3d4044;
}
