@charset "UTF-8";
/* ============================================================
   style_index.css - 橙子CMS 前台首页专用样式
   v2.0 (2026-09-10) - TBS内核兼容版
   核心改动：display:flex/grid → inline-block + 固定高度
   规避移动端QQ浏览器(TBS内核) Flex/Grid渲染缺陷
   ============================================================ */

/* ============================================================
   首页通用容器
   ============================================================ */
.index-section {
    padding: 16px 18px 20px 18px;
}
.index-section .section-header {
    /* 用 inline-block 替代 flex 实现左右对齐 */
    position: relative;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
}
.index-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}
.index-section .more-link {
    font-size: 14px;
    color: #1a73e8;
    position: absolute;
    right: 0;
    top: 4px;
}

/* ============================================================
   通知区域
   ============================================================ */
.index-notification {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
    padding: 10px 16px;
    border-radius: 6px;
    color: #1a73e8;
}

/* ============================================================
   C区域：热门推荐
   ============================================================ */
/* 用 inline-block 替代 flex 实现左右两栏 */
.hot-layout {
    font-size: 0; /* 消除 inline-block 间隙 */
    position: relative;
}

/* ===== 左侧：相册轮播 ===== */
.hot-carousel {
    display: inline-block;
    vertical-align: top;
    width: 50%;
    height: 370px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    position: relative;
    box-sizing: border-box;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.carousel-slide.active {
    display: block;
}
.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

/* 轮播背景图 */
.carousel-slide-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}
.carousel-slide a:hover .carousel-slide-bg {
    transform: scale(1.02);
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 16px 14px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

/* 轮播按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: white;
    border: none;
    font-size: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    line-height: 38px;
    text-align: center;
    transition: background 0.3s, transform 0.2s;
}
.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.08);
}
.carousel-prev {
    left: 12px;
}
.carousel-next {
    right: 12px;
}

/* 轮播指示点 */
.carousel-dots {
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}
.carousel-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: background 0.3s;
}
.carousel-dot.active {
    background: white;
}
.carousel-dot:hover {
    background: rgba(255,255,255,0.7);
}

/* ===== 右侧：文章列表（与轮播等高） ===== */
/* 用 inline-block 替代 flex 实现右侧栏 */
.hot-right {
    display: inline-block;
    vertical-align: top;
    width: 49%;
    height: 370px;
    margin-left: 1%;
    box-sizing: border-box;
    position: relative;
}

/* 推荐文章：固定高度 */
.hot-articles-block.recommended {
    height: 170px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* 热门文章：填充剩余空间 */
.hot-articles-block.popular {
    height: 190px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-sizing: border-box;
}

.hot-articles-block .hot-sub-title {
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    font-weight: 600;
}
.hot-articles-block.recommended .hot-sub-title {
    color: #1a73e8;
}
.hot-articles-block.popular .hot-sub-title {
    color: #e65100;
}

/* 文章列表项：用 table 布局替代 flex */
.hot-articles-block .hot-article-item {
    padding: 5px 0;
    border-bottom: 1px dashed #f0f0f0;
    line-height: 1.5;
    display: block;
    width: 100%;
}
.hot-articles-block .hot-article-item:last-child {
    border-bottom: none;
}
.hot-articles-block .hot-article-item a {
    display: table;
    width: 100%;
    color: #333;
    font-size: 14px;
    transition: color 0.3s;
    text-decoration: none;
    table-layout: fixed;
}
.hot-articles-block .hot-article-item a:hover {
    color: #1a73e8;
    text-decoration: none;
}
.hot-article-title {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}
.hot-article-date {
    display: table-cell;
    vertical-align: middle;
    font-size: 12px;
    color: #bbb;
    white-space: nowrap;
    width: 50px;
    text-align: right;
}

.hot-articles-block .hot-empty {
    color: #bbb;
    font-size: 13px;
    padding: 6px 0;
    text-align: center;
}

/* ============================================================
   D区域：最新文章（双列列表布局）
   用 inline-block 替代 flex 实现左右双列
   ============================================================ */
.index-article-columns {
    font-size: 0; /* 消除 inline-block 间隙 */
}
.index-article-col {
    display: inline-block;
    vertical-align: top;
    width: 48%;
    margin-right: 4%;
    box-sizing: border-box;
    overflow: hidden; /* ⑦ 防止内容溢出到右列 */
}
.index-article-col:last-child {
    margin-right: 0;
}
.index-article-list-item {
    margin-bottom: 0;
    border-bottom: 1px dashed #e0e0e0; /* ⑧ 浅灰虚线分隔，替代独立 divider */
}
.index-article-list-item:last-child {
    border-bottom: none; /* 最后一项不显示分割线 */
}
.article-list-link {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 10px 0 8px 0;
    transition: background 0.2s;
    border-radius: 4px;
    overflow: hidden; /* ⑦ 防止内容溢出 */
}
.article-list-link:hover {
    background: #f8f9ff;
}
.article-list-link:hover .article-list-title {
    color: #1a73e8;
}
/* 第一行：标题+日期，用 table 布局替代 flex */
.article-list-row1 {
    display: table;
    width: 100%;
    margin-bottom: 4px;
    table-layout: fixed;
}
.article-list-title {
    display: table-cell;
    vertical-align: baseline;
    font-size: 14px; /* ⑥ 缩小标题字号 */
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 65%; /* ⑥ 限制标题宽度，留出日期空间 */
    max-width: 65%; /* ⑥ 双重保险防止标题撑满 */
}
.article-list-date {
    display: table-cell;
    vertical-align: baseline;
    font-size: 12px; /* ⑥ 缩小日期字号 */
    color: #999;
    white-space: nowrap;
    width: 35%; /* ⑥ 配合标题宽度 */
    text-align: right;
}
.article-list-row2 {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    /* ⑧ 用 -webkit-line-clamp 替代 max-height，正确截断两行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 旧版独立 divider 已由 item border-bottom 替代，保留以防旧模板引用 */
.article-list-divider {
    display: none;
}

/* ============================================================
   E区域：最新相册
   用 inline-block 替代 flex/grid 实现卡片网格
   ============================================================ */
.index-album-grid {
    font-size: 0; /* 消除 inline-block 间隙 */
    text-align: left;
}
.index-album-card {
    display: inline-block;
    vertical-align: top;
    width: 23%;
    margin: 0 1% 14px 1%;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.index-album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.index-album-card a {
    display: block;
    color: #333;
    text-decoration: none;
}
.index-album-cover {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
    position: relative;
    overflow: hidden;
}
.index-album-cover .cover-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.index-album-name {
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 移除 @supports(display: grid) 渐进增强 - TBS 内核会误报支持 grid 但渲染有缺陷 */

/* ============================================================
   F区域：友情链接（首页）
   ============================================================ */
.index-links-grid {
    font-size: 0;
    text-align: left;
}
.index-links-grid .link-item {
    display: inline-block;
    vertical-align: middle;
    margin: 0 20px 10px 0;
}
.index-links-grid .link-item a {
    color: #1a73e8;
    font-size: 14px;
}

/* ============================================================
   D2区域：产品展示（首页）
   用 inline-block 替代 flex/grid 实现 TBS 兼容
   ============================================================ */
.index-product-section {
    padding: 16px 18px 20px 18px;
}
.index-product-section .section-header {
    position: relative;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f2f5;
}
.index-product-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}
.index-product-section .more-link {
    font-size: 14px;
    color: #1a73e8;
    position: absolute;
    right: 0;
    top: 4px;
}
.index-product-grid {
    font-size: 0;
    text-align: left;
    margin: 0 -7px;
}
.index-product-card {
    display: inline-block;
    vertical-align: top;
    width: 20%;
    padding: 0 7px;
    margin-bottom: 14px;
    box-sizing: border-box;
}
.index-product-card a {
    display: block;
    text-decoration: none;
    color: #333;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.3s, box-shadow 0.3s;
}
.index-product-card a:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.index-product-cover {
    height: 160px;
    overflow: hidden;
    background: #e9ecef;
    position: relative;
}
.index-product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Placeholder: 用 inline-block + text-align 替代 flex */
.product-cover-placeholder {
    text-align: center;
    line-height: 160px;
    font-size: 48px;
    color: #ccc;
}
.index-product-name {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.index-product-price {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #e65100;
    padding-bottom: 8px;
}

/* ============================================================
   响应式 - 平板 (1024px 以下)
   ============================================================ */
@media (max-width: 1024px) {
    .index-article-col {
        width: 48%;
    }
    .index-album-card {
        width: 31.33%;
    }
    .index-product-card {
        width: 25%;
    }
}

/* ============================================================
   响应式 - 手机 (768px 以下)
   ============================================================ */
@media (max-width: 768px) {
    .index-section {
        padding: 12px 12px 16px 12px;
    }
    .index-section .section-title {
        font-size: 16px;
    }

    /* C区域：上下排列 */
    .hot-layout {
        font-size: 0;
    }
    .hot-carousel {
        display: block;
        width: 100%;
        height: 220px;
        margin-bottom: 12px;
    }
    .hot-right {
        display: block;
        width: 100%;
        margin-left: 0;
        height: auto;
    }
    .hot-articles-block {
        padding: 8px 12px;
        margin-bottom: 8px;
    }
    .hot-articles-block.recommended {
        height: auto;
    }
    .hot-articles-block.popular {
        height: auto;
    }
    .hot-articles-block .hot-article-item a {
        font-size: 12px;
    }
    .hot-article-date {
        font-size: 10px;
    }
    .carousel-caption {
        font-size: 13px;
        padding: 12px 12px 10px 12px;
    }
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        line-height: 32px;
    }
    .carousel-prev {
        left: 8px;
    }
    .carousel-next {
        right: 8px;
    }
    .carousel-dots {
        bottom: 38px;
    }
    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    /* D区域：手机端单列 */
    .index-article-col {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    .article-list-title {
        font-size: 14px;
    }
    .article-list-row2 {
        font-size: 12px;
    }
    /* E区域：2列 */
    .index-album-card {
        width: 48%;
        margin: 0 1% 10px 1%;
    }
    .index-album-cover {
        height: 120px;
    }

    /* D2产品：3列 */
    .index-product-card {
        width: 33.33%;
    }
    .index-product-cover {
        height: 130px;
    }
    .product-cover-placeholder {
        line-height: 130px;
        font-size: 36px;
    }

    .index-links-grid .link-item {
        margin: 0 14px 8px 0;
    }
    .index-links-grid .link-item a {
        font-size: 13px;
    }
}

/* ============================================================
   响应式 - 小屏手机 (480px 以下)
   ============================================================ */
@media (max-width: 480px) {
    .hot-carousel {
        height: 180px;
    }
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        line-height: 28px;
    }
    .carousel-prev {
        left: 6px;
    }
    .carousel-next {
        right: 6px;
    }
    .carousel-caption {
        font-size: 12px;
        padding: 10px 10px 8px 10px;
    }
    .carousel-dots {
        bottom: 32px;
    }
    .carousel-dot {
        width: 6px;
        height: 6px;
    }

    .hot-articles-block .hot-article-item a {
        font-size: 12px;
    }
    .hot-article-title {
        font-size: 12px;
    }
    .hot-article-date {
        font-size: 10px;
    }

    .article-list-title {
        font-size: 13px;
    }

    .index-album-card {
        width: 48%;
        margin: 0 1% 8px 1%;
    }
    .index-album-cover {
        height: 100px;
    }
    .index-album-name {
        font-size: 12px;
        padding: 6px 8px;
    }

    /* D2产品：2列 */
    .index-product-card {
        width: 48%;
    }
    .index-product-cover {
        height: 110px;
    }
    .product-cover-placeholder {
        line-height: 110px;
        font-size: 32px;
    }
    .index-product-name {
        font-size: 12px;
    }
    .index-product-price {
        font-size: 12px;
    }

    .index-section {
        padding: 8px 8px 12px 8px;
    }
    .index-section .section-title {
        font-size: 15px;
    }
}
