﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif;
    background: #eef2f5;
    color: #1e2f3a;
    line-height: 1.5;
    font-size: 16px;
}

/* 主容器：自适应最大宽度，居中 */
.view {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    overflow-x: hidden;
}

/* ----- 头部样式：绿色背景衬托白色Logo / 左+右自适应 (缩放始终导航靠右) ----- */
.header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background-color: #2c7a3e;  /* 绿色底色，让白色Logo清晰 */
    padding: 0.8rem 1.8rem;
    gap: 0.8rem;
}

/* 左侧Logo区域：永远靠左 */
.header-home {
    flex-shrink: 0;
}

.header-home .logo {
    display: inline-block;
    line-height: 0;
}

.all-img {
    max-height: 52px;
    width: auto;
    display: block;
}

/* 右侧导航区域：即使换行也整体靠右 */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.header-nav-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.2rem;
}

.header-nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0;
    transition: opacity 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.header-nav-link:hover {
    opacity: 0.85;
    border-bottom-color: #f9e45b;
}

.clr:after {
    content: "";
    display: table;
    clear: both;
}

/* 详情内容区域 */
.col-detail-con {
    padding: 1.5rem 1.8rem;
    border-bottom: 1px dashed #e2e8f0;
}

.detail-box {
    max-width: 100%;
}

.detail-title h2 {
    font-size: 1.9rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #1a3b2e;
    word-break: break-word;
}

.detail-tips {
    font-size: 0.85rem;
    color: #6c7a89;
    border-bottom: 1px solid #eef2f6;
    padding-bottom: 0.9rem;
    margin-bottom: 1.2rem;
}

/* 文章正文区 —— 自适应 */
.mod-detail-infro {
    font-size: 1rem;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mod-detail-infro img,
.mod-detail-infro video,
.mod-detail-infro iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2rem auto;
    border-radius: 12px;
}

.mod-detail-infro table {
    width: 100%;
    overflow-x: auto;
    display: block;
    max-width: 100%;
    border-collapse: collapse;
}

.mod-detail-infro table td,
.mod-detail-infro table th {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
}

.mod-detail-infro pre,
.mod-detail-infro code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.5rem;
}

/* 上下篇导航 */
.col-details-tip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
    background: #f9fafc;
    padding: 1rem 1.2rem;
    border-radius: 20px;
    margin-top: 2rem;
}

.details-tips-prev {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-tips-prev span {
    font-weight: 600;
    color: #2c7a3e;
    margin-right: 5px;
}

/* ---------- 猜你喜欢模块：一行两个LI (两列网格) + 每个LI内部左右结构 ---------- */
.mod-wrap {
    margin-top: 0.5rem;
    padding: 0 0 1.5rem 0;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    padding-left: 1rem;
    border-left: 5px solid #2c7a3e;
    margin: 1rem 0 1.2rem 1.2rem;
    color: #1f3b2c;
}


/* 关键: 两列布局，一行两个LI，共15个LI (每行显示2个，自适应屏幕) */
.u-like-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    list-style: none;
    padding: 0 1.2rem 1rem;
    margin: 0;
}

/* 每个LI卡片内部：左右结构（标题在左，操作在右） */
.u-like-link {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f8;
    padding: 0.9rem 1rem;
    gap: 0.75rem;
}

.u-like-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(44, 122, 62, 0.12);
    border-color: #cbdca0;
    background: #fefef7;
}

/* 左侧标题文本：限制两行，自动换行，占据剩余空间 */
.u-like-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e2f3c;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    text-align: left;
}

/* 右侧的“箭头/阅读”指示器，实现左右分明 */
.u-like-arrow {
    flex-shrink: 0;
    font-size: 1rem;
    color: #2c7a3e;
    background: #eef5e9;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    transition: background 0.2s;
}

.u-like-link:hover .u-like-arrow {
    background: #2c7a3e;
    color: white;
}

/* 底部footer样式 */
.footer {
    background: #f0f4ea;
    text-align: center;
    padding: 1.2rem 1rem;
    font-size: 0.8rem;
    color: #4a5b6e;
    border-top: 1px solid #dee4e9;
    margin-top: 1rem;
}

.footer p {
    margin: 0;
}

/* 分页样式 */
.paging {
    margin: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* 辅助工具类 */
.mb-20 { margin-bottom: 1.25rem; }
.mt-20 { margin-top: 1.25rem; }
.ml-2 { margin-left: 0.5rem; }
.b-b-dashed { border-bottom: 1px dashed #e2e8f0; }

/* ---------- 响应式断点：平板 & 手机 ---------- */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .header {
        padding: 0.6rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    .header-home {
        text-align: center;
    }
    .header-nav {
        justify-content: center;
    }
    .header-nav-item {
        justify-content: center;
        gap: 0.6rem 1rem;
    }
    .header-nav-link {
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .col-detail-con {
        padding: 1rem 1.2rem;
    }
    .detail-title h2 {
        font-size: 1.5rem;
    }
    /* 手机屏幕：猜你喜欢变成单列 (一行一个LI) 内部依然左右结构 */
    .u-like-items {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.8rem 1rem;
    }
    .u-like-link {
        padding: 0.8rem 1rem;
    }
    .related-title {
        font-size: 1.3rem;
        margin-left: 0.8rem;
    }
    .col-details-tip {
        flex-direction: column;
        white-space: normal;
    }
    .details-tips-prev {
        white-space: normal;
        word-break: break-word;
    }
    .all-img {
        max-height: 44px;
    }
}

@media screen and (max-width: 480px) {
    .header-nav-item {
        gap: 0.4rem 0.8rem;
        flex-wrap: wrap;
    }
    .header-nav-link {
        font-size: 0.75rem;
    }
    .detail-title h2 {
        font-size: 1.25rem;
    }
    .u-like-text {
        font-size: 0.85rem;
    }
    .u-like-arrow {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
    .related-title {
        font-size: 1.2rem;
    }
}

/* 保证任何第三方内容自适应 */
img, iframe, video, embed {
    max-width: 100%;
    height: auto;
}