/* 详情页专用样式 */

/* 面包屑导航 */
.breadcrumb {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e8e8e8;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb a:hover {
    color: #1890ff;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ccc;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* 详情页容器 */
.detail-container {
    padding: 40px 0;
}

.detail-container .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* 主要内容 */
.detail-content {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 成语标题区域 */
.chengyu-header {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.chengyu-title {
    font-size: 42px;
    color: #1890ff;
    margin-bottom: 15px;
}

.chengyu-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.chengyu-meta span {
    color: #666;
    font-size: 16px;
}

.chengyu-meta .pinyin {
    font-weight: 500;
}

.chengyu-actions {
    display: flex;
    gap: 15px;
}

.chengyu-actions button {
    padding: 8px 20px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.chengyu-actions button:hover {
    border-color: #1890ff;
    color: #1890ff;
}

/* 详情章节 */
.detail-section {
    margin-bottom: 35px;
}

.section-heading {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid #1890ff;
}

.section-content {
    padding-left: 20px;
}

.explanation {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.source {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    font-style: italic;
}

/* 例句列表 */
.example-list {
    list-style: none;
}

.example-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.8;
    color: #555;
}

.example-list li::before {
    content: '📝';
    position: absolute;
    left: 0;
}

/* 标签列表 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.tag {
    display: inline-block;
    padding: 8px 18px;
    background: #f0f2f5;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
    transition: all 0.3s;
}

.tag:hover {
    background: #1890ff;
    color: #fff;
    transform: translateY(-2px);
}

.category-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.category-tag:hover {
    opacity: 0.8;
}

.tip {
    font-size: 14px;
    color: #999;
}

.link-primary {
    color: #1890ff;
    font-weight: 500;
}

.link-primary:hover {
    text-decoration: underline;
}

/* 成语接龙预览 */
.jielong-desc {
    margin-bottom: 15px;
    line-height: 1.8;
}

.jielong-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.jielong-item {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    color: #333;
    transition: all 0.3s;
}

.jielong-item:hover {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* 成语故事 */
.story-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.more-link-wrapper {
    text-align: center;
}

.more-link {
    display: inline-block;
    padding: 10px 25px;
    background: #1890ff;
    color: #fff;
    border-radius: 20px;
}

.more-link:hover {
    background: #40a9ff;
}

/* 相关成语推荐 */
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.related-card {
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.related-card:hover {
    background: #e6f7ff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(24,144,255,0.2);
}

.related-card h4 {
    font-size: 18px;
    color: #1890ff;
    margin-bottom: 8px;
}

.related-card .pinyin {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.related-card .desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 侧边栏 */
.detail-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-widget {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.widget-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}

/* 快速搜索 */
.quick-search {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.quick-search input {
    flex: 1;
    min-width: 0;  /* 防止flex子元素溢出 */
    padding: 8px 12px;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.quick-search input:focus {
    border-color: #1890ff !important;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.quick-search input::placeholder {
    color: #bfbfbf;
}

.quick-search button {
    padding: 8px 16px;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;  /* 按钮不缩小 */
    box-sizing: border-box;
}

.quick-search button:hover {
    border-color: #1890ff !important;
    color: #1890ff !important;
    background: #f0f8ff !important;
}

/* 热门列表 */
.hot-list {
    list-style: none;
}

.hot-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

.hot-list li:last-child {
    border-bottom: none;
}

.hot-list a {
    color: #555;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.hot-list a::before {
    content: '▪';
    color: #1890ff;
    margin-right: 8px;
}

.hot-list a:hover {
    color: #1890ff;
}

/* 字母网格 */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.letter-grid a {
    padding: 10px;
    text-align: center;
    background: #f0f2f5;
    border-radius: 5px;
    color: #333;
    font-weight: 500;
}

.letter-grid a:hover {
    background: #1890ff;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .detail-container .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-sidebar {
        position: static;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .chengyu-title {
        font-size: 32px;
    }

    .detail-content {
        padding: 25px 20px;
    }
    
    .letter-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .letter-grid a {
        padding: 8px 5px;
        font-size: 13px;
    }
}

/* 移动端优化 - 防止横向滚动 */
@media (max-width: 768px) {
    /* 容器内边距减小 */
    .container {
        padding: 0 15px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* 确保所有内容不溢出 */
    * {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 面包屑导航 */
    .breadcrumb {
        padding: 12px 0;
    }
    
    .breadcrumb .container {
        font-size: 14px;
    }
    
    .breadcrumb .separator {
        margin: 0 5px;
    }
    
    /* 详情页容器 */
    .detail-container {
        padding: 20px 0;
    }
    
    .detail-container .container {
        gap: 15px;
    }
    
    /* 主要内容区域 */
    .detail-content {
        padding: 20px 15px;
        border-radius: 8px;
    }
    
    /* 成语标题 */
    .chengyu-header {
        padding-bottom: 20px;
        margin-bottom: 25px;
    }
    
    .chengyu-title {
        font-size: 28px;
        word-break: break-all;
    }
    
    /* 元信息 */
    .chengyu-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .chengyu-meta span {
        font-size: 14px;
    }
    
    /* 操作按钮 */
    .chengyu-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .chengyu-actions button {
        padding: 6px 15px;
        font-size: 13px;
    }
    
    /* 章节标题 */
    .section-heading {
        font-size: 20px;
        margin-bottom: 15px;
        padding-left: 12px;
        border-left-width: 3px;
    }
    
    .section-content {
        padding-left: 15px;
    }
    
    /* 解释区域 */
    .explanation {
        font-size: 15px;
        padding: 15px;
        line-height: 1.7;
    }
    
    .source {
        font-size: 14px;
        line-height: 1.7;
    }
    
    /* 例句列表 */
    .example-list li {
        padding: 10px 0;
        padding-left: 25px;
        font-size: 14px;
        line-height: 1.7;
    }
    
    /* 标签 */
    .tag-list {
        gap: 8px;
    }
    
    .tag {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* 成语接龙 */
    .jielong-preview {
        gap: 8px;
    }
    
    .jielong-item {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* 成语故事 */
    .story-content {
        padding: 15px;
        font-size: 14px;
        line-height: 1.7;
    }
    
    /* 相关成语卡片 */
    .related-card {
        padding: 15px;
    }
    
    .related-card h4 {
        font-size: 16px;
    }
    
    .related-card .pinyin {
        font-size: 12px;
    }
    
    .related-card .desc {
        font-size: 13px;
    }
    
    /* 侧边栏 */
    .sidebar-widget {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .widget-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    /* 快速搜索 - 移动端优化 */
    .quick-search {
        gap: 6px;
        margin-top: 12px;
    }
    
    .quick-search input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .quick-search button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 字母网格 */
    .letter-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    
    .letter-grid a {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* 热门列表 */
    .hot-list li {
        padding: 8px 0;
    }
    
    .hot-list a {
        font-size: 14px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .detail-content {
        padding: 15px 10px;
    }
    
    .chengyu-title {
        font-size: 24px;
    }
    
    .section-heading {
        font-size: 18px;
    }
    
    .letter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chengyu-meta {
        font-size: 13px;
    }
    
    .chengyu-actions button {
        flex: 1;
        min-width: 0;
    }
}

