﻿/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 基础样式 */
:root {
    --primary-color: #4e8cbb;
    --primary-dark: #3a7cb2;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #f5f5f5;
    --border-color: #e6d8b6;
    --hover-color: #b89b5b;
    --section-bg: #f9f6ec;
    --card-shadow: 0 2px 12px rgba(180,160,100,0.10);
}

body {
    font-family: "Microsoft YaHei", "SimSun", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

    a:hover {
        color: var(--primary-color);
    }

ul, li {
    list-style: none;
}

.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 主体内容 */


/* 左侧内容区域 */
.m-bdbl {
    float: left;
    width: 70%;
    padding-right: 5px;
}

/* 右侧边栏 */
.m-bdbr {
    float: right;
    width: 30%;
}

/* 专题区块通用样式 */
.topic-section,
.sidebar-section,
.quote-item {
    background: var(--section-bg) !important;
    border-radius: 14px !important;
    box-shadow: var(--card-shadow) !important;
    border: 1px solid var(--border-color) !important;
    padding: 5px !important;
    margin-bottom: 5px !important;
}

/* 统一标题风格 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

    .section-header h2,
    .section-header h3,
    .quote-item h3,
    .idiom-category h3 {
        color: #7c5c1e !important;
        font-size: 19px !important;
        font-weight: bold !important;
        letter-spacing: 1px;
        margin: 0;
        background: none !important;
        padding-left: 0 !important;
        position: static !important;
    }

        .section-header h2:before,
        .section-header h3:before,
        .quote-item h3:before,
        .idiom-category h3:before {
            display: none !important;
        }

/* 统一标签风格 */
.idiom-tags a,
.classic-tag,
.hot-term {
    background: #f3e9d7 !important;
    color: var(--hover-color) !important;
    border-radius: 15px !important;
    border: 1px solid var(--border-color) !important;
    padding: 5px 14px !important;
    font-size: 14px !important;
    margin-bottom: 6px;
    transition: background 0.2s, color 0.2s;
}

    .idiom-tags a:hover,
    .classic-tag:hover,
    .hot-term:hover {
        background: #e9d8b4 !important;
        color: #7c5c1e !important;
    }

/* 统一分割线和按钮风格 */
.section-header .more {
    color: var(--hover-color) !important;
    background: #f3e9d7 !important;
    border-radius: 15px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    transition: all 0.3s;
    text-decoration: none;
}

    .section-header .more:hover {
        color: #fff !important;
        background: var(--hover-color) !important;
    }

/* 右侧热门/最新栏目卡片风格 */
.hot-topic,
.new-topic {
    background: #f3e9d7 !important;
    border-radius: 10px !important;
    color: #7c5c1e !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 10px;
    padding: 10px 14px !important;
    font-size: 15px !important;
    transition: background 0.2s, color 0.2s;
}

    .hot-topic:hover,
    .new-topic:hover {
        background: #e9d8b4 !important;
        color: #7c5c1e !important;
    }

    .hot-topic .rank {
        background: var(--hover-color) !important;
        color: #fff !important;
    }

/* 诗词专题样式 */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 诗词专题卡片风格优化 */
.topic-item {
    display: flex;
    gap: 5px;
    padding: 5px;
    background: var(--section-bg);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}

    .topic-item:hover {
        box-shadow: 0 6px 24px rgba(180,160,100,0.18);
        border-color: var(--border-color);
        transform: translateY(-2px) scale(1.01);
    }

.topic-cover {
    flex: 0 0 120px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f3e9d7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 120px;
    box-shadow: 0 1px 6px rgba(180,160,100,0.08);
}

.book-cover {
    width: 100px;
    height: 120px;
    background: linear-gradient(135deg, #e9d8b4 60%, #f3e9d7 100%);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 18px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(180,160,100,0.10);
}

.book-title {
    color: #7c5c1e;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.2;
}

.book-author {
    color: var(--hover-color);
    font-size: 13px;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

.topic-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

    .topic-info h3 {
        font-size: 19px;
        margin-bottom: 8px;
        font-weight: bold;
        color: #5a4321;
        padding-left: 0;
        position: static;
    }

        .topic-info h3:before {
            display: none;
        }

        .topic-info h3 a {
            color: #5a4321;
            transition: color 0.3s;
            font-weight: bold;
        }

            .topic-info h3 a:hover {
                color: var(--hover-color);
            }

    .topic-info p {
        color: #6d5b3b;
        line-height: 1.8;
        font-size: 15px;
        background: none;
        -webkit-line-clamp: 3;
    }

.topic-meta {
    display: flex;
    gap: 18px;
    color: var(--hover-color);
    font-size: 13px;
    margin-top: 0;
}

    .topic-meta i {
        font-size: 15px;
        color: var(--hover-color);
        opacity: 0.85;
    }

/* 名句专题样式 */
.quote-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.quote-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

    .quote-item h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }

        .quote-item h3 a {
            color: var(--text-color);
        }

            .quote-item h3 a:hover {
                color: var(--primary-color);
            }

.quote-content {
    color: var(--text-light);
    line-height: 1.8;
}

    .quote-content p {
        margin-bottom: 10px;
    }

/* 成语专题样式 - 现代卡片风格 */
.idiom-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 15px 0;
}

/* 成语专题项目样式 - 卡片设计 */
.idiom-item {
    position: relative;
    background: linear-gradient(135deg, #fff 0%, #fefcf8 100%);
    border-radius: 16px;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 4px 20px rgba(124, 92, 30, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.idiom-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e6d8b6, #f3e9d7, #e9d8b4);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.idiom-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(124, 92, 30, 0.15);
    border-color: rgba(184, 155, 91, 0.3);
}

.idiom-item:hover::before {
    opacity: 1;
}

/* 成语专题头部样式 - 带装饰 */
.idiom-header {
    position: relative;
    padding: 24px 24px 16px 24px;
    background: linear-gradient(135deg, #f9f6ec 0%, #f3e9d7 100%);
    border-bottom: 2px solid rgba(230, 216, 182, 0.3);
}

.idiom-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #b89b5b, #e6d8b6, #b89b5b);
    border-radius: 16px 16px 0 0;
}

.idiom-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #5a4321;
    text-align: center;
    position: relative;
}

.idiom-header h3 a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.idiom-header h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #b89b5b, #e6d8b6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.idiom-header h3 a:hover {
    color: #b89b5b;
}

.idiom-header h3 a:hover::after {
    width: 100%;
}

/* 成语内容区域样式 - 优雅布局 */
.idiom-content {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
}

.idiom-content p {
    margin: 0;
    color: #6d5b3b;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* 成语元信息样式 - 底部装饰 */
.idiom-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 20px 24px;
    background: rgba(249, 246, 236, 0.5);
    border-top: 1px solid rgba(230, 216, 182, 0.3);
}

.idiom-count {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #b89b5b, #d4c49a);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(184, 155, 91, 0.3);
    transition: all 0.3s ease;
}

.idiom-count:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(184, 155, 91, 0.4);
}

.idiom-count i {
    margin-right: 6px;
    font-size: 16px;
}

.idiom-meta .category {
    background: linear-gradient(135deg, rgba(124, 92, 30, 0.1), rgba(184, 155, 91, 0.1));
    color: #7c5c1e;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 15px;
    border: 1px solid rgba(124, 92, 30, 0.2);
    transition: all 0.3s ease;
}

.idiom-meta .category:hover {
    background: linear-gradient(135deg, rgba(124, 92, 30, 0.15), rgba(184, 155, 91, 0.15));
    border-color: rgba(124, 92, 30, 0.3);
}

/* 响应式布局 - 优化 */
@media screen and (max-width: 768px) {
    .idiom-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 10px 0;
    }

    .idiom-item {
        border-radius: 12px;
    }

    .idiom-header {
        padding: 20px 20px 14px 20px;
    }

    .idiom-header h3 {
        font-size: 18px;
    }

    .idiom-content {
        padding: 16px 20px;
        min-height: 70px;
    }

    .idiom-content p {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .idiom-meta {
        padding: 14px 20px 18px 20px;
    }

    .idiom-count {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .idiom-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .idiom-item {
        margin: 0 5px;
    }
}

/* 右侧边栏样式 */
.sidebar-section {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 热门专题和最新专题共用样式 */
.hot-topics,
.new-topics {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hot-topic {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    transition: all 0.3s;
}

.hot-topic:hover {
    background: #f0f0f0;
}

.hot-topic .rank {
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    margin-right: 10px;
}

.hot-topic .title {
    flex: 1;
    color: var(--text-color);
}

.hot-topic .count {
    color: var(--text-lighter);
    font-size: 12px;
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid #e0e0e0;
}

.hot-topic .date {
    color: var(--text-lighter);
    font-size: 12px;
    white-space: nowrap;
    margin-left: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .new-topics .new-topic {
        padding: 10px;
    }
    
    .new-topics .title {
        font-size: 14px;
    }
    
    .new-topics .count,
    .new-topics .date {
        font-size: 12px;
    }
}

/* 响应式布局 */
@media screen and (max-width: 768px) {
  



    .m-bdbl,
    .m-bdbr {
        float: none;
        width: 100%;
        padding-right: 0;
    }

    .topic-item {
        flex-direction: column;
    }

    .topic-cover {
        margin-bottom: 12px;
        min-width: 100px;
        min-height: 100px;
    }

    .book-cover {
        width: 80px;
        height: 80px;
        padding: 12px 6px 6px 6px;
    }

    .quote-list {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    .m-nav,
    .m-bdbr,
    .back-to-top {
        display: none;
    }

    .m-bdbl {
        float: none;
        width: 100%;
        padding-right: 0;
    }

    .topic-section,
    .sidebar-section,
    .quote-item {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    a {
        text-decoration: none;
        color: var(--text-color);
    }

        a[href]:after {
            content: " (" attr(href) ")";
            font-size: 12px;
            color: var(--text-lighter);
        }
}

.topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.topic-header h3 {
    margin: 0;
    flex: 1;
    font-size: 19px;
    font-weight: bold;
    color: #5a4321;
    padding-left: 0;
    position: static;
}

.topic-header h3:before {
    display: none;
}

.topic-header h3 a {
    color: #5a4321;
    text-decoration: none;
    transition: color 0.3s;
}

.topic-header h3 a:hover {
    color: var(--hover-color);
}

.poem-count {
    color: var(--hover-color);
    font-size: 14px;
    margin-left: 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.poem-count i {
    margin-right: 5px;
    color: var(--hover-color);
    font-size: 15px;
}

/* 名句专题样式增强 */
.quote-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    width: 100%;
}

.quote-header h3 {
    margin: 0;
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: #7c5c1e;
    padding-left: 0;
    position: static;
}

.quote-header h3:before {
    display: none;
}

.quote-header h3 a {
    color: #7c5c1e;
    text-decoration: none;
    transition: color 0.3s;
}

.quote-header h3 a:hover {
    color: var(--hover-color);
}

.quote-count {
    color: var(--hover-color);
    font-size: 14px;
    margin-left: 15px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    background: #f3e9d7;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.quote-count i {
    margin-right: 5px;
    color: var(--hover-color);
    font-size: 14px;
}

.quote-meta {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e6d8b6;
}

.quote-meta .category {
    background: #f3e9d7;
    color: var(--hover-color);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    border: 1px solid var(--border-color);
}

/* 名句专题列表布局优化 */
.quote-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 5px;
}

/* 响应式调整 - 名句专题 */
@media screen and (max-width: 768px) {
    .quote-list {
        grid-template-columns: 1fr;
        gap: 1px;
    }
    
    .quote-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .quote-count {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* 头部右侧区域样式 */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.total-count {
    color: var(--text-lighter);
    font-size: 14px;
    font-weight: normal;
}

/* 成语专题 - 强化浮动小方块模式 - 古典主题 */
.idiom-cards-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 5px !important;
}

.idiom-card {
    background: linear-gradient(145deg, #fefcf8 0%, #f9f6ec 50%, #f3e9d7 100%) !important;
    border: 2px solid #e6d8b6 !important;
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 140px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 4px 15px rgba(124, 92, 30, 0.1) !important;
    transform: translateZ(0) !important;
}

.idiom-card:hover {
    transform: translateY(-10px) scale(1.03) !important;
    box-shadow: 0 15px 35px rgba(124, 92, 30, 0.2) !important;
    border-color: #b89b5b !important;
    background: linear-gradient(145deg, #fefcf8 0%, #f6f0e3 50%, #ede0c7 100%) !important;
}

.idiom-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #b89b5b, #d4c49a, #e6d8b6, #b89b5b, #7c5c1e) !important;
    opacity: 0 !important;
    transition: opacity 0.4s ease !important;
    border-radius: 16px 16px 0 0 !important;
}

.idiom-card:hover::before {
    opacity: 1 !important;
}

.idiom-card::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    background: radial-gradient(circle, rgba(184, 155, 91, 0.08) 0%, transparent 70%) !important;
    border-radius: 50% !important;
    transition: all 0.4s ease !important;
    transform: translate(-50%, -50%) !important;
    z-index: 0 !important;
}

.idiom-card:hover::after {
    width: 200px !important;
    height: 200px !important;
}

.card-header {
    margin-bottom: 12px !important;
    position: relative !important;
    z-index: 1 !important;
}

.card-header h4 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #5a4321 !important;
}

.card-header h4 a {
    color: #5a4321 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    display: inline-block !important;
}

.card-header h4 a:hover {
    color: #b89b5b !important;
    transform: scale(1.05) !important;
}

.card-content {
    flex: 1 !important;
    margin-bottom: 15px !important;
    position: relative !important;
    z-index: 1 !important;
    text-align: center !important;
}

.card-content .keywords {
    font-size: 13px !important;
    color: #6d5b3b !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-style: italic !important;
    background: rgba(230, 216, 182, 0.15) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: 1px dashed rgba(124, 92, 30, 0.2) !important;
}

.card-footer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1 !important;
}

.count-badge {
    background: linear-gradient(135deg, #b89b5b 0%, #7c5c1e 100%) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(124, 92, 30, 0.3) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.count-badge::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
    transition: left 0.5s ease !important;
}

.idiom-card:hover .count-badge {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(124, 92, 30, 0.4) !important;
}

.idiom-card:hover .count-badge::before {
    left: 100% !important;
}

/* 响应式设计 - 强化 */
@media (max-width: 768px) {
    .idiom-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px !important;
        padding: 8px !important;
    }
    
    .idiom-card {
        padding: 15px !important;
        min-height: 120px !important;
    }
    
    .card-header h4 {
        font-size: 16px !important;
    }
    
    .card-content .keywords {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    .count-badge {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 480px) {
    .idiom-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 12px !important;
        padding: 5px !important;
    }
    
    .idiom-card {
        padding: 12px !important;
        min-height: 100px !important;
    }
    
    .card-header h4 {
        font-size: 14px !important;
    }
    
    .card-content .keywords {
        font-size: 11px !important;
        padding: 5px 8px !important;
    }
    
    .count-badge {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
}