﻿/* ===== 古诗列表页面样式 ===== */

/* ===== 基础布局 ===== */
.main-content {
    background-color: #f5f5f5;
    min-height: 500px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-layout {
    display: flex;
    gap: 5px;
    align-items: flex-start;
}

.main-left {
    flex: 1;
    min-width: 0;
}

.main-right {
    width: 300px;
    flex-shrink: 0;
}

/* ===== 古诗分类样式 ===== */
.poetry-types {
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.poetry-types h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 5px;
    border-bottom: 2px solid #e6d8b6;
    background: #fff;
}



.type-section:last-child {
    margin-bottom: 0;
}

.type-header {
    margin-bottom: 8px;
}

.type-header h3 {
    color: #5a4321 !important;
    font-size: 16px !important;
    margin: 0 0 8px 0 !important;
    padding-left: 8px !important;
    border-left: 3px solid #b89b5b !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.type-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-item {
    background: #f3e9d7;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #e6d8b6;
    transition: all 0.3s ease;
}

.type-item:hover {
    background: #e9d8b4;
    border-color: #b89b5b;
    transform: translateY(-1px);
}

.type-item a {
    color: #19537D;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== 古诗列表样式 ===== */
.poetry-list {
    background: #f9f6ec;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.poetry-list h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 5px;
    border-bottom: 2px solid #e6d8b6;
    background: #fff;
}

.poetry-item {
    padding: 5px;
    margin-bottom: 3px;
    border: 1px solid #e6d8b6;
    transition: all 0.3s ease;
    background: #ffffff;
}

.poetry-item:last-child {
    border-bottom: none;
}



.poetry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    position: relative;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e6d8b6;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-meta {
    flex: 1;
    min-width: 0;
}

.poetry-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    width: 100%;
}

.poetry-title {
    font-size: 18px;
    color: #5a4321;
    font-weight: 500;
}

.poetry-title a {
    color: #5a4321;
    text-decoration: none;
}

.poetry-title a:hover {
    color: #8b6b4a;
    text-decoration: underline;
}

.poetry-author {
    color: #8b6b4a;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}



.poetry-summary {
    margin-top: 6px;
    padding-left: 72px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.summary-label {
    font-weight: 500;
    color: #8b6b4a;
}

.summary-text {
    color: #6d5b3b;
}

.poetry-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-left: 72px;
}

/* 懒加载图片样式 */
.lazy-load {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

.tag {
    background: #f3e9d7;
    color: #8b6b4a;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
    border: 1px solid #e6d8b6;
}

.poetry-content {
    color: #6d5b3b;
    font-size: 16px;
    line-height: 1.8;
    padding-left: 72px;
    margin-top: 8px;
}

/* ===== 操作按钮样式 ===== */
.poetry-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f3e9d7;
    color: #8b6b4a;
    border: 1px solid #e6d8b6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    outline: none;
}

.action-btn:hover {
    background: #e9d8b4;
    color: #5a4321;
    border-color: #b89b5b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn:focus {
    outline: 2px solid #b89b5b;
    outline-offset: 2px;
}

.action-btn.active {
    background: #8b6b4a;
    color: #fff;
    border-color: #8b6b4a;
}

.action-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.action-btn.loading::after {
    content: "...";
    animation: loading 1s infinite;
}

@keyframes loading {
    0%, 33% { content: "."; }
    34%, 66% { content: ".."; }
    67%, 100% { content: "..."; }
}

/* ===== 热门推荐样式 ===== */
.hot-poetry {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e6d8b6;
}

.hot-poetry h2 {
    color: #5a4321;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e6d8b6;
    display: flex;
    align-items: center;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e6d8b6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-item:hover {
    background: #f3e9d7;
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
}

.hot-rank-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.hot-item:nth-child(1) .hot-rank-circle {
    background: linear-gradient(135deg, #b89b5b, #8b6b4a);
}

.hot-item:nth-child(2) .hot-rank-circle {
    background: linear-gradient(135deg, #c0a97d, #9c8661);
}

.hot-item:nth-child(3) .hot-rank-circle {
    background: linear-gradient(135deg, #d4bc91, #b89b5b);
}

.hot-item:nth-child(n+4) .hot-rank-circle {
    background: linear-gradient(135deg, #d4caba, #b8aa96);
}

.hot-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.hot-title a {
    color: #5a4321;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-title a:hover {
    color: #8b6b4a;
}

.hot-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8b6b4a;
    flex-shrink: 0;
}

.hot-author {
    color: #6d5b3b;
    font-weight: 400;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-views {
    color: #6d5b3b;
    font-weight: 500;
    background: #f3e9d7;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    border: 1px solid #e6d8b6;
}

/* ===== 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 5px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    background: #f9f6ec;
    color: #5a4321;
    text-decoration: none;
    border: 1px solid #e6d8b6;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination a:hover {
    background: #f3e9d7;
    color: #8b6b4a;
    border-color: #d4bc91;
}

.pagination a.active {
    background: #8b6b4a;
    color: #fff;
    border-color: #8b6b4a;
    cursor: default;
}

.pagination .ellipsis {
    padding: 8px 4px;
    color: #8b6b4a;
    font-size: 14px;
}

/* ===== 诗词额外内容显示区域 ===== */
.poetry-extra-content {
    margin-top: 15px;
    padding: 15px;
    background: #f8f5e8;
    border: 1px solid #e6d8b6;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6d8b6;
}

.close-btn {
    cursor: pointer;
    color: #8b6b4a;
    font-size: 18px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e6d8b6;
    color: #5a4321;
}

.content-body {
    color: #6d5b3b;
    font-size: 14px;
    line-height: 1.8;
    white-space:normal;
}





/* ===== 语音朗读控制样式 ===== */
.speech-controls {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.speech-controls button {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.play-btn {
    background-color: #4CAF50;
    color: white;
}

.play-btn:hover {
    background-color: #45a049;
}

.pause-btn {
    background-color: #ff9800;
    color: white;
}

.pause-btn:hover {
    background-color: #e68a00;
}

.stop-btn {
    background-color: #f44336;
    color: white;
}

.stop-btn:hover {
    background-color: #d32f2f;
}

.speech-status {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.audio-player {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.audio-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

/* ===== 选定文本区域样式 ===== */
.selected-text {
    background-color: #f8f5e8;
    border: 1px solid #e6d8b6;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    line-height: 1.8;
    color: #5a4321;
    font-size: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.selected-text p {
    margin: 0 0 10px 0;
    line-height: 1.8;
}

.selected-text br {
    display: block;
    content: "";
    margin-top: 10px;
}

/* ===== 移动端折叠功能样式 ===== */
.type-header h3 .mobile-more {
    font-size: 14px;
    font-weight: normal;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== 响应式设计 ===== */

/* PC端样式 (大于768px) */
@media (min-width: 769px) {
    .type-header {
        display: flex !important;
        align-items: flex-start !important;
        gap: 15px !important;
        margin-bottom: 8px !important;
    }
    
    .type-header h3 {
        margin: 0 !important;
        min-width: 100px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        width: auto !important;
        justify-content: flex-start !important;
    }
    
    .type-list {
        flex: 1 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 0 !important;
    }
    
    .mobile-more {
        display: none !important;
    }
}

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 10px;
    }
    
    .main-layout {
        gap: 15px;
    }
    
    .main-right {
        width: 250px;
    }
    
  
}

/* 移动设备 (最大宽度 768px) */
@media (max-width: 768px) {
    /* 移动端折叠功能 */
    .mobile-more {
        cursor: pointer;
        color: #666;
        display: inline-block;
    }
    
    .mobile-more:hover {
        color: #333;
    }
    
    .type-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        overflow: hidden;
        max-height: 2.5em; /* 约一行的高度 */
        transition: max-height 0.3s ease;
    }
    
    .type-list.expanded {
        max-height: none;
    }
    
    .type-item {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
    
    .container {
        padding: 0;
        margin: 0;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .poetry-types,
    .poetry-list,
    .hot-poetry {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .main-layout {
        flex-direction: column;
        gap: 0;
        margin: 0;
    }
    
    .main-right {
        width: 100%;
    }
    
    /* 分类区域优化 */
    .poetry-types h1 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .type-header {
        display: block;
    }
    
    .type-header h3 {
        font-size: 14px;
        margin-bottom: 8px;
        min-width: auto;
        white-space: normal;
    }
    
    .type-list {
        width: 100%;
        gap: 6px;
    }
    

    
    .type-item a {
        font-size: 16px;
    }
    
    /* 诗词列表优化 */
    .poetry-list h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
   
    .author-info {
        gap: 10px;
    }
    
    .author-avatar {
        width: 50px;
        height: 50px;
    }
    
    .poetry-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .poetry-actions {
        position: static;
        margin-top: 8px;
        gap: 4px;
    }
    
    .poetry-content {
        padding-left: 60px;
        font-size: 16px;
        margin-top: 10px;
    }
    
    .poetry-summary {
        padding-left: 60px;
        margin-top: 6px;
        font-size: 13px;
    }
    
    .poetry-tags {
        padding-left: 60px;
        margin-top: 8px;
    }
    
 
    .poetry-author {
        font-size: 16px;
    }
    
    .action-btn {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
    
    /* 热门推荐移动端优化 */
    .hot-poetry h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .hot-item {
        padding: 10px 0;
    }
    
    .hot-title {
        font-size: 16px;
    }
    
    .hot-meta {
        font-size: 16px;
    }
    
    /* 分页移动端优化 */
    .pagination {
        padding: 10px 0;
    }
    
    .pagination a {
        padding: 6px 10px;
        font-size: 16px;
    }
    
    /* 其他内容优化 */
    .poetry-extra-content {
        margin-top: 10px;
    }
    
    .content-body {
        font-size: 16px;
    }
    
    .close-btn {
        font-size: 16px;
    }
    
   
    .selected-text {
        padding: 12px;
        font-size: 15px;
        line-height: 1.6;
    }
}

/* 小屏手机设备 (最大宽度 480px) */
@media (max-width: 480px) {
    .poetry-types,
    .poetry-list,
    .hot-poetry {
        padding: 1px;
        border-bottom: 1px solid #ddd;
    }
    
    .poetry-types h1 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .type-section h3 {
        font-size: 14px;
    }
    
    .type-item a {
        font-size: 16px;
    }
    
    .poetry-list h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
  
    
    .author-avatar {
        width: 45px;
        height: 45px;
    }
    
    .poetry-content {
        padding-left: 55px;
        font-size: 16px;
    }
    
    .poetry-summary {
        padding-left: 55px;
        margin-top: 5px;
        font-size: 12px;
    }
    
    .poetry-tags {
        padding-left: 55px;
        margin-top: 6px;
    }
    
    .poetry-title {
        font-size: 16px;
    }
    
    .poetry-author {
        font-size: 16px;
    }
    
    .tag {
        font-size: 14px;
        padding: 1px 6px;
    }
    
    .action-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .hot-poetry h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .hot-item {
        padding: 8px 0;
        gap: 8px;
    }
    
    .hot-rank-circle {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .hot-title {
        font-size: 16px;
    }
    
    .hot-meta {
        font-size: 16px;
    }
    
    .hot-author {
        max-width: 60px;
    }
    
    .pagination {
        margin-top: 15px;
        padding: 12px 0;
    }
    
    .pagination a {
        padding: 5px 8px;
        font-size: 16px;
    }
    
    .content-body {
        font-size: 16px;
    }
    
    
    .selected-text {
        padding: 10px;
        font-size: 14px;
        line-height: 1.5;
        margin: 8px 0;
    }
    
    .selected-text p {
        margin: 0 0 8px 0;
    }
    
    .selected-text br {
        margin-top: 8px;
    }
}

/* 超小屏设备 (最大宽度 320px) */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }
    
    .poetry-types,
    .poetry-list {
        padding: 8px;
    }
    
    .poetry-item {
        padding: 8px;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
    }
    
    .poetry-content {
        padding-left: 50px;
        font-size: 13px;
    }
    
    .poetry-summary {
        padding-left: 50px;
        margin-top: 4px;
        font-size: 11px;
    }
    
    .poetry-tags {
        padding-left: 50px;
        margin-top: 5px;
    }
    
    .poetry-title {
        font-size: 14px;
    }
    
    .action-btn {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
    
    .hot-poetry {
        padding: 10px;
    }
    
    .hot-item {
        gap: 6px;
    }
    
    .hot-rank-circle {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .selected-text {
        padding: 8px;
        font-size: 13px;
        line-height: 1.4;
        margin: 6px 0;
    }
}