/* ========================================
   首页样式 - 清理版本
   PC端和移动端分离设计
======================================== */

/* ========================================
   CSS变量定义 - 符合WCAG AA标准的颜色对比度
======================================== */
:root {
    --primary-color: #2c5282; /* 提高对比度 4.5:1 */
    --primary-dark: #2a4365; /* 提高对比度 */
    --text-color: #1a202c; /* 提高对比度 7:1 */
    --text-light: #4a5568; /* 提高对比度 4.5:1 */
    --text-lighter: #718096; /* 提高对比度 */
    --bg-color: #f7fafc;
    --border-color: #e2e8f0;
    --hover-color: #805ad5;
    --section-bg: #f7fafc;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.1);
    --gradient-bg: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem;  /* 8px */
    --spacing-md: 0.75rem; /* 12px */
    --spacing-lg: 1rem;    /* 16px */
    --spacing-xl: 1.5rem;  /* 24px */
    --spacing-2xl: 2rem;   /* 32px */
    
    /* 响应式断点 */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    
    /* 无障碍访问 */
    --focus-ring: 0 0 0 3px rgba(66, 153, 225, 0.5);
    --focus-ring-offset: 2px;
}

/* ========================================
   基础样式重置和无障碍访问
======================================== */
* {
    box-sizing: border-box;
    border-radius: 0 !important;
}

/* 无障碍访问 - 焦点样式 */
*:focus {
    outline: none;
    box-shadow: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* 跳过链接 - 键盘导航 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 响应式容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 流体网格系统 */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* 弹性布局工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ========================================
   PC端样式 (默认样式)
======================================== */

/* 主容器 - 响应式设计 */
.homepage-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-color);
    min-width: 0;
    overflow-x: hidden;
    padding: 0 var(--spacing-md);
}

/* 响应式容器调整 */
@media (max-width: 640px) {
    .homepage-container {
        padding: 0;
    }
}

@media (min-width: 1200px) {
    .homepage-container {
       padding-left: 5px;
       padding-right: 5px;;
    }
}

/* 顶部英雄区域 */
.hero-section {
    background: var(--gradient-bg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    height: 200px;
    margin-top: 5px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 5px;
    align-items: center;
    height: 100%;
}

/* 热门搜索区域 */
.daily-poem {
    background: white;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 0.5px solid var(--border-color);
    height: 200px;
}

.daily-poem-title {
    color: #7c5c1e;
    font-size: 16px;
    margin: 0 0 3px 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.hot-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.hot-term {
    background: #fff;
    color: var(--text-light);
    padding: 6px 12px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 0.5px solid #e0d9c8;
    white-space: nowrap;
}

.hot-term:hover {
    background: linear-gradient(135deg, #f5f2e9, #ede8da);
    color: var(--text-color);
    text-decoration: none;
}

/* 轮播图样式 */
.banner-slideshow {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    height: 200px;
}

.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
}

.slide.active,
.slide:first-child {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    font-size: 16px;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    z-index: 10;
}

.prev {
    left: var(--spacing-md);
}

.next {
    right: var(--spacing-md);
}

.prev:hover, .next:hover {
    background: rgba(0,0,0,0.7);
}

.dots-container {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-sm);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 5px;
    margin-bottom: var(--spacing-xl);
    margin-top: 5px;
}

.content-left {
    padding: 5px;
    box-shadow: var(--card-shadow);
    border: 0.5px solid var(--border-color);
}

.content-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 更新区域样式 */
.update-section {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 0.5px solid var(--border-color);
}

.update-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    color: #7c5c1e;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1px;
}

.more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 15px;
    background: rgba(78, 140, 187, 0.1);
    transition: all 0.3s ease;
}

.more-link:hover {
    background: rgba(78, 140, 187, 0.2);
    text-decoration: none;
}

/* 诗词列表样式 */
.poetry-item-home {
    padding: 5px;
    margin-bottom: 3px;
    border: 0.5px solid var(--border-color);
    transition: all 0.3s ease;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* PC端：水平布局 - 头像、内容、功能按钮 */
.poetry-header-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.author-meta-home {
    flex: 1;
    display: flex;
    flex-direction: row; /* PC端：水平排列 */
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* PC端默认样式 */
.poetry-title-author-row {
    display: contents; /* PC端不需要额外包装 */
}

.poetry-info-area {
    display: contents; /* PC端不需要额外包装 */
}

.poetry-author-dynasty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.author-avatar-home {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border: 0.5px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.author-avatar-home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poetry-title-home {
    font-size: 18px;
    color: #5a4321;
    font-weight: 500;
}

.poetry-title-home a {
    color: #5a4321;
    text-decoration: none;
}

.poetry-title-home a:hover {
    color: #8b6b4a;
    text-decoration: underline;
}

.poetry-author-home {
    color: #8b6b4a;
    font-size: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.dynasty-home {
    color: #999;
}

/* PC端：功能按钮样式 - 一行显示靠右 */
.poetry-actions-home {
    display: flex !important;
    flex-direction: row !important;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap !important;
    align-self: flex-start;
    margin-left: auto; /* 推到右边 */
}

.poetry-actions-home .action-btn-home {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    background: #f3e9d7 !important;
    color: #8b6b4a !important;
    border: 1px solid #e6d8b6 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 12px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-family: inherit !important;
    padding: 0 !important;
    outline: none !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.poetry-actions-home .action-btn-home:hover {
    background: #e9d8b4 !important;
    color: #5a4321 !important;
    border-color: #b89b5b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.poetry-actions-home .action-btn-home:focus {
    outline: 2px solid #b89b5b !important;
    outline-offset: 2px !important;
}

.poetry-actions-home .action-btn-home.active {
    background: #8b6b4a !important;
    color: #fff !important;
    border-color: #8b6b4a !important;
}

.poetry-actions-home .action-btn-home.loading {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.poetry-actions-home .action-btn-home.loading::after {
    content: "..." !important;
    animation: loading 1s infinite !important;
}

@keyframes loading {
    0%, 33% { content: "."; }
    34%, 66% { content: ".."; }
    67%, 100% { content: "..."; }
}

.poetry-content-home {
    color: #6d5b3b;
    font-size: 16px;
    line-height: 1.8;
    width: 100%;
    margin-top: var(--spacing-xs);
    text-align: center;
}

.poetry-extra-content-home {
    margin-top: 5px;
    padding: 5px;
    background: #f8f5e8;
    border: 1px solid #e6d8b6;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-header-home {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid #e6d8b6;
}

.close-btn-home {
    cursor: pointer;
    color: #4a5568; /* 提高对比度 */
    font-size: 18px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.close-btn-home:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.close-btn-home:focus {
    box-shadow: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.content-body-home {
    color: #6d5b3b;
    font-size: 14px;
    line-height: 1.8;
    white-space: normal;
}

/* 文章列表样式 */
.article-item {
    padding: var(--spacing-lg);
    border-bottom: 0.5px solid #f3e9d6;
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: var(--spacing-xs);
    border: 0.5px solid #e0d9c8;
}

.article-item:last-child {
    border-bottom: 0.5px solid #e0d9c8;
    margin-bottom: 0;
}



.article-meta {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-lg);
}

.article-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 14px;
}

/* 成语列表样式 */
.chengyu-item {
    border-bottom: 0.5px solid #f3e9d6;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    transition: all 0.3s ease;
    background: #fff;
    border: 0.5px solid #e0d9c8;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}

.chengyu-item:last-child {
    border-bottom: 0.5px solid #e0d9c8;
    margin-bottom: 0;
}



.chengyu-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    flex-shrink: 0;
}

.chengyu-content h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.chengyu-content a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}



.chengyu-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    white-space: nowrap;
}

.chengyu-era {
    color: var(--text-light);
    font-size: 11px;
    flex-shrink: 0;
    background: rgba(184, 155, 91, 0.1);
    padding: 1px 4px;
    border: 0.5px solid rgba(184, 155, 91, 0.2);
    margin-right: 4px;
}

.chengyu-desc {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.4;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 名句列表样式 */
.mingju-item {
    border-bottom: 0.5px solid #f3e9d6;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    transition: all 0.3s ease;
    background: #fff;
    border: 0.5px solid #e0d9c8;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}

.mingju-item:last-child {
    border-bottom: 0.5px solid #e0d9c8;
    margin-bottom: 0;
}



.mingju-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mingju-content h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.mingju-content a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}



.mingju-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(243, 233, 214, 0.4);
    padding: 4px 12px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.mingju-meta span:first-child {
    color: #7c5c1e;
    font-weight: 500;
}

.mingju-meta span:nth-child(2) {
    color: #a1845c;
}

.mingju-meta span:last-child {
    color: #6d5b3b;
}

/* 侧边栏样式 */
.sidebar-section {
    background: var(--section-bg);
    padding: 5px;
    box-shadow: var(--card-shadow);
    border: 0.5px solid var(--border-color);
}

.sidebar-title {
    color: #7c5c1e;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 2px 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 1px;
}

/* 侧边栏专题列表样式 */
.sidebar-section .topic-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: 2px;
    background: #fff;
    border: 0.5px solid #e0d9c8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s;
    margin-top: 2px;
}


/* 作者头像样式 */
.sidebar-section .author-avatar {
    width: 80px;
    height: 100px;
  
    overflow: hidden;
    border: 0.5px solid #bcd2e6;
    background: #fff;
}

.sidebar-section .author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-section .author-name {
    font-size: 14px;
    font-weight: bold;
    color: #2d5c8a;
    margin-bottom: 2px;
    text-align: center;
    line-height: 1.2;
}

.sidebar-section .author-dynasty {
    font-size: 8px;
    color: #5a7ca8;
    text-align: center;
}

/* 古籍封面样式 */
.topic-cover {
    flex: 0 0 60px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 100px;
}

.sidebar-section .book-cover {
    position: relative;
    width: 80px;
    height: 100px;
    background: #fcf9f3;
    box-shadow: 0 2px 8px rgba(180,160,100,0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    padding-top: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-section .book-cover-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #b89b5b, #e6d8b6 80%);
}

.sidebar-section .book-cover-left {
    position: absolute;
    top: 6px;
    left: 1px;
    bottom: 6px;
    width: 1px;
    background: #e6d8b6;
}

.sidebar-section .book-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #d5b788, #8b6b4a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    z-index: 1;
}

.sidebar-section .book-icon span {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.sidebar-section .book-title {
    font-size: 12px;
    font-weight: bold;
    color: #5a442e;
    margin-bottom: 2px;
    text-align: center;
    z-index: 1;
    line-height: 1.2;
}

.sidebar-section .book-author {
    font-size: 10px;
    color: #b0a48a;
    text-align: center;
    z-index: 1;
}

/* 专题信息样式 */
.sidebar-section .topic-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.sidebar-section .topic-info h3 {
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: bold;
    color: #5a4321;
    line-height: 1.3;
}

.sidebar-section .topic-info h3 a {
    color: #5a442e;
    transition: color 0.3s;
    font-weight: bold;
    text-decoration: none;
}


.sidebar-section .book-meta {
    color: #8b6b4a;
    font-size: 11px;
    margin-top: 4px;
}

.sidebar-section .book-meta span {
    margin-right: var(--spacing-xs);
    display: inline-block;
}

.sidebar-section .author-meta {
    color: #2d5c8a;
    font-size: 12px;
    margin-top: 4px;
}

.sidebar-section .author-meta .stats {
    margin-right: var(--spacing-xs);
    display: inline-block;
}

.sidebar-section .topic-info p {
    color: #6d5b3b;
    margin: 4px 0 0 0;
    line-height: 1.4;
    font-size: 13px;
}

/* 标签网格样式 */
.topic-tags {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-sm);
}

.tag-link {
    background: #fff;
    color: var(--text-light);
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 0.5px solid #e0d9c8;
    text-align: center;
    display: block;
    min-height: 20px;
    line-height: 1.2;
}



/* 字典词典网格样式 */
.zidian-grid, .cidian-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 3px;
}

.zidian-item, .cidian-item {
    background: #fff;
    padding: var(--spacing-md);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: 0.5px solid #e0d9c8;
}



.char, .word {
    display: block;
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.pinyin {
    font-size: 11px;
    color: var(--text-light);
}

/* 懒加载图片样式 */
.lazy-image {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

.lazy-image.error {
    opacity: 0.5;
    background: #f8f9fa;
}

/* 拼音显示样式 - 复制自pinyin.css */
.pinyin-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.pinyin-line {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    margin: 10px 0;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.pinyin-char-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 2.2em;
    min-width: 2.2em;
    max-width: 2.2em;
}

.pinyin-char-group .pinyin {
    color: #7d97ad;
    font-size: 13px;
    line-height: 1.2;
    border-bottom: 1px dotted #bdbdbd;
    width: 100%;
    text-align: center;
    font-family: Arial, sans-serif;
    margin-bottom: 2px;
    white-space: nowrap;
}

.pinyin-char-group .hanzi {
    color: #222;
    font-size: 20px;
    line-height: 1.5;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    text-align: center;
    width: 100%;
}

.pinyin-char-group.punct .pinyin {
    border-bottom: none;
    color: transparent;
}

.pinyin-char-group.punct .hanzi {
    color: #222;
}

.poem-irregular {
    text-align: left;
    align-items: flex-start;
}

.poem-irregular .pinyin-char-group {
    align-items: flex-start;
    width: auto;
    min-width: auto;
    max-width: none;
}

.poem-irregular .pinyin-line {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
}

.poetry-extra-content-home .pinyin-wrapper {
    margin: 10px 0;
    background: #f9f6ec;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e6d8b6;
}

.poetry-extra-content-home .pinyin-wrapper h3 {
    color: #5a4321;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6d8b6;
}

/* 语音朗读控制样式 */
.speech-controls {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
}

.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;
}


.pause-btn {
    background-color: #ff9800;
    color: white;
}


.stop-btn {
    background-color: #f44336;
    color: white;
}



.speech-status {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
    text-align: center;
    padding: 8px;
    background: #f9f6ec;
    border-radius: 4px;
}

.audio-player {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.audio-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

/* ========================================
   响应式设计 - 移动优先方法
======================================== */

/* 小屏设备 (640px及以下) */
@media (max-width: 640px) {
    .homepage-container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* 中等屏设备 (768px及以下) */
@media (max-width: 768px) {
    /* 基础移动端优化 */
    .homepage-container {
        padding: 0 var(--spacing-sm);
        min-width: 0;
        overflow-x: hidden;
    }
    
    /* 触摸友好的链接和按钮 */
    a:not(.action-btn-home), button:not(.action-btn-home) {
        min-width: 44px;
        align-items: center;
        justify-content: center;
    }
    
    /* 防止文本选择问题 */
    .poetry-actions-home, .hot-terms {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* 优化滚动性能 */
    .main-content, .hero-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 移动端字体优化 */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* 顶部区域优化 */
    .hero-section {
        height: auto;
        min-height: 120px;
  
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .daily-poem {
        height: auto;
        min-height: 80px;
        padding: var(--spacing-sm);
    }
    
    .daily-poem-title {
        font-size: 14px;
        margin-bottom: var(--spacing-xs);
    }
    
    .hot-terms {
        gap: var(--spacing-xs);
        flex-wrap: wrap;
        max-height: 80px;
        overflow: hidden;
        justify-content: flex-start;
    }
    
    .hot-term {
        font-size: 12px;
        padding: 4px 8px;
        white-space: nowrap;
        flex-shrink: 0;
        margin-bottom: 2px;
    }
    
    .banner-slideshow {
        height: 100px;
        margin-top: var(--spacing-sm);
    }
    
    .slide-caption {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    .prev, .next {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .dots-container {
        bottom: 5px;
    }
    
    /* 主内容区域优化 */
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .content-left, .content-right {
        padding: var(--spacing-sm);
        min-width: 0;
    }
    
    /* 标题优化 */
    .section-title {
        font-size: 14px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--spacing-sm);
    }
    
    .more-link {
        font-size: 12px;
        padding: 2px 6px;
    }
    
    /* 诗词项目优化 */
    .poetry-item-home {
        padding: 10px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e6d8b6;
        background: #fff;
    }
    
    /* 手机端：诗词项目布局 - 左头像右内容 */
    .poetry-header-info {
        display: flex;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 8px;
        align-items: flex-start;
    }
    
    .author-avatar-home {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    /* 右边：内容区域（上下两行） */
    .author-meta-home {
        flex: 1;
        display: flex;
        flex-direction: column !important; /* 手机端强制垂直布局 */
        align-items: flex-start !important;
        gap: 1px;
        min-width: 0;
    }
    
    /* 右上：标题、作者、朝代在一行 */
    .poetry-info-area {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .poetry-title-home {
        font-size: 16px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .poetry-author-dynasty {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .poetry-author-home {
        font-size: 13px;
        color: #8b6b4a;
        white-space: nowrap;
    }
    
    .dynasty-home {
        color: #999;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* 右下：功能按钮独立一行 */
    .poetry-actions-home {
        display: flex;
        flex-direction: row;
        gap: 4px;
        flex-wrap: nowrap;
        margin-top: 0;
    }
    
    .poetry-actions-home .action-btn-home {
        width: 30px !important;
        height: 30px !important;
        font-size: 11px !important;
        min-height: 30px !important;
        min-width: 30px !important;
        flex-shrink: 0 !important;
        border: 1px solid #e6d8b6 !important;
        border-radius: 4px !important;
        background: #f3e9d7 !important;
        color: #8b6b4a !important;
        font-weight: 500 !important;
    }
    
 
    
    .poetry-content-home {
    
        line-height: 2;
        margin-top: 1px;
        text-align: center;
    }
    
    /* 文章项目优化 */
    .article-item {
        padding: 12px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e6d8b6;
        background: #fff;
    }
    
    .article-meta {
        font-size: 12px;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 8px;
        color: #666;
    }
    
    .article-excerpt {
        font-size: 14px;
        line-height: 1.6;
        color: #6d5b3b;
    }
    
    /* 成语项目优化 */
    .chengyu-item {
        padding: 12px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e6d8b6;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .chengyu-content {
        width: 100%;
    }
    
    .chengyu-content h3 {
        margin: 0;
        font-size: 16px;
        line-height: 1.4;
    }
    
    .chengyu-content a {
        color: #333;
        text-decoration: none;
    }
    
    .chengyu-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .chengyu-era {
        font-size: 11px;
        padding: 2px 6px;
        background: rgba(78, 140, 187, 0.1);
        border: 1px solid rgba(78, 140, 187, 0.2);
        border-radius: 3px;
        color: #4e8cbb;
    }
    
    .chengyu-desc {
        font-size: 13px;
        color: #666;
        line-height: 1.5;
        margin-top: 4px;
        width: 100%;
    }
    
    /* 名句项目优化 */
    .mingju-item {
        padding: 12px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e6d8b6;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .mingju-content {
        width: 100%;
    }
    
    .mingju-content h3 {
        margin: 0;
        font-size: 16px;
        line-height: 1.6;
    }
    
    .mingju-content a {
        color: #333;
        text-decoration: none;
        display: block;
        line-height: 1.8;
    }
    
    .mingju-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        color: #666;
        flex-wrap: wrap;
        background: rgba(243, 233, 214, 0.4);
        padding: 4px 8px;
        border-radius: 4px;
    }
    
    /* 侧边栏优化 */
    .sidebar-section {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .sidebar-title {
        font-size: 14px;
        margin-bottom: var(--spacing-sm);
    }
    
    /* 作者列表优化 */
    .topic-item {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
        display: flex;
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .sidebar-section .author-avatar {
        width: 35px;
        height: 35px;
    }
    
    .sidebar-section .author-name {
        font-size: 11px;
    }
    
    .sidebar-section .author-dynasty {
        font-size: 9px;
    }
    
    .topic-info h3 {
        font-size: 13px;
        margin-bottom: var(--spacing-xs);
    }
    
    .topic-info p {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .author-meta, .book-meta {
        font-size: 10px;
        gap: var(--spacing-xs);
    }
    
    /* 古籍封面优化 */
    .sidebar-section .book-cover {
        width: 35px;
        height: 45px;
        padding-top: 8px;
    }
    
    .sidebar-section .book-icon {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .sidebar-section .book-title {
        font-size: 8px;
    }
    
    .sidebar-section .book-author {
        font-size: 7px;
    }
    
    /* 标签网格优化 */
    .topic-tags {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: var(--spacing-xs);
    }
    
    .tag-link {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .zidian-grid, .cidian-grid {

        gap: var(--spacing-xs);
    }
    
    .zidian-item, .cidian-item {
        padding: var(--spacing-xs);
    }
    
    .char, .word {
        font-size: 14px;
    }
    
    .pinyin {
        font-size: 10px;
    }
    
    /* 移动端拼音样式优化 */
    .pinyin-char-group {
        width: 1.3em;
        min-width: 1.3em;
        max-width: 1.3em;
    }
    
    .pinyin-char-group .pinyin {
        font-size: 9px;
        margin-bottom: 1px;
        white-space: nowrap;
    }
    
    .pinyin-char-group .hanzi {
        font-size: 13px;
    }
    
    .poem-irregular .pinyin-char-group {
        width: auto;
        min-width: auto;
        max-width: none;
    }
    
    .poetry-extra-content-home .pinyin-wrapper {
        padding: 10px;
        margin: 8px 0;
    }
    
    .poetry-extra-content-home .pinyin-wrapper h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    /* 移动端朗读控制优化 */
    .speech-controls {
        gap: 6px;
        margin: 8px 0;
    }
    
    .speech-controls button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 50px;
    }
    
    .audio-player {
        padding: 12px;
        margin-top: 8px;
    }
    
    .audio-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .speech-status {
        font-size: 12px;
        padding: 6px;
        margin-top: 6px;
    }
}

/* ========================================
   小屏手机端样式 (480px及以下)
======================================== */
@media (max-width: 480px) {
    .homepage-container {
        padding: 0 ;
    }
    
    /* 顶部区域进一步优化 */
    .hero-section {
        height: auto;
        min-height: 100px;

    }
    
    .hero-content {
        padding: var(--spacing-xs);
        gap: var(--spacing-xs);
    }
    
    .daily-poem {
        min-height: 60px;
        padding: var(--spacing-xs);
    }
    
    .daily-poem-title {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .hot-terms {
        gap: 2px;
        flex-wrap: wrap;
        max-height: 50px;
        overflow: hidden;
    }
    
    .hot-term {
        font-size: 14px;
        padding: 1px 4px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .banner-slideshow {
        margin-top: var(--spacing-xs);
    }
    
    .slide-caption {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .prev, .next {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    /* 主内容区域进一步优化 */
    .main-content {
        gap: var(--spacing-sm);
    }
    
    .content-left, .content-right {
        padding: var(--spacing-xs);
    }
    
    /* 标题进一步优化 */
    .section-title {
        font-size: 16px;
        margin-bottom: var(--spacing-xs);
    }
    
    .more-link {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    /* 诗词项目进一步优化 */
    .poetry-item-home {
        padding: var(--spacing-xs);
        margin-bottom: 2px;
    }
    
    .poetry-header-info {
        flex-direction: row;
        gap: 1px;
        align-items: flex-start;
    }
    
    .author-avatar-home {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }
    
    .author-meta-home {
        flex: 1;
        min-width: 0;
    }
    
    .poetry-actions-home {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 5px;
        margin-top: 0;
        flex-shrink: 0;
        flex-wrap: nowrap;
        margin-left: 5px;
    }
    
    .poetry-title-home {
        font-size: 16px;
    }
    
    .poetry-author-home {
        font-size: 11px;
    }
    
    .poetry-actions-home .action-btn-home {
        width: 26px !important;
        height: 26px !important;
        font-size: 12px !important;
        min-height: 26px !important;
        min-width: 26px !important;
        flex-shrink: 0 !important;
        border: 1px solid #e6d8b6 !important;
        border-radius: 4px !important;
        background: #f3e9d7 !important;
        color: #8b6b4a !important;
    }
    
  
    .poetry-content-home {
        font-size: 15px;
        
    }
    
    /* 文章项目进一步优化 */
    .article-item {
        padding: var(--spacing-xs);
        margin-bottom: 2px;
    }
    
    .article-meta {
        font-size: 14px;
        gap: 20px;
    }
    
    .article-excerpt {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* 成语项目进一步优化 */
    .chengyu-item {
        padding: var(--spacing-xs);
        margin-bottom: 2px;
        gap: 4px;
        flex-direction: column;
    }
    
    .chengyu-content h3 {
        font-size: 13px;
    }
    
    .chengyu-meta {
        width: 100%;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .chengyu-era {
        font-size: 12px;
        padding: 1px 4px;
    }
    
    .chengyu-desc {
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        width: 100%;
        margin-top: 2px;
        line-height: 1.3;
    }
    
    /* 名句项目进一步优化 */
    .mingju-item {
        padding: var(--spacing-xs);
        margin-bottom: 2px;
        gap: 4px;
        flex-direction: column;
    }
    
    .mingju-content h3 {
        font-size: 13px;
    }
    
    .mingju-content a {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .mingju-meta {
        font-size: 13px;
        width: 100%;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    /* 侧边栏进一步优化 */
    .sidebar-section {
        padding: var(--spacing-xs);
        margin-bottom: var(--spacing-xs);
    }
    
    .sidebar-title {
        font-size: 13px;
        margin-bottom: var(--spacing-xs);
    }
    
    .topic-item {
        padding: var(--spacing-xs);
        margin-bottom: 2px;
        gap: var(--spacing-xs);
    }
    
    .sidebar-section .author-avatar {
        width: 70px;
        height: 80px;
    }
    
    .sidebar-section .author-name {
        font-size: 10px;
    }
    
    .sidebar-section .author-dynasty {
        font-size: 8px;
    }
    
    .topic-info h3 {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .topic-info p {
        font-size: 10px;
        line-height: 1.3;
    }
    
    .author-meta, .book-meta {
        font-size: 9px;
        gap: 2px;
    }
    
    /* 古籍封面进一步优化 */
    .sidebar-section .book-cover {
        width: 75px;
        height: 90px;
        padding-top: 5px;
    }
    
    .sidebar-section .book-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .sidebar-section .book-title {
        font-size: 12px;
    }
    
    .sidebar-section .book-author {
        font-size: 12px;
    }
    
    /* 标签网格进一步优化 */
    .topic-tags {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 2px;
    }
    
    .tag-link {
        font-size: 14px;
    }
    
    .zidian-grid, .cidian-grid {
        gap: 2px;
    }
    
    .zidian-item, .cidian-item {
        padding: 2px;
    }
    
    .char, .word {
        font-size: 16px;
    }
    
    .pinyin {
        font-size: 12px;
    }
}

/* ========================================
   超小屏手机端样式 (320px及以下)
======================================== */
@media (max-width: 320px) {
    .homepage-container {
        padding: 0 2px;
    }
    
    .hero-section {
        min-height: 80px;
    }
    
    .daily-poem {
        min-height: 50px;
    }
    
    .daily-poem-title {
        font-size: 11px;
    }
    
    .hot-term {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .banner-slideshow {
        height: 60px;
    }
    
    .section-title {
        font-size: 12px;
    }
    
    .poetry-header-info {
        gap: 2px;
    }
    
    .author-avatar-home {
        width: 30px;
        height: 30px;
    }
    
    .poetry-title-home {
        font-size: 13px;
    }
    
    .poetry-actions-home .action-btn-home {
        width: 22px !important;
        height: 22px !important;
        font-size: 8px !important;
        min-height: 22px !important;
        min-width: 22px !important;
        flex-shrink: 0 !important;
        border: 1px solid #e6d8b6 !important;
        border-radius: 4px !important;
        background: #f3e9d7 !important;
        color: #8b6b4a !important;
    }
    

    .poetry-content-home {
        font-size: 12px;
    }
    
    /* 名句和成语项目优化 */
    .mingju-item, .chengyu-item {
        gap: 2px;
    }
    
    .mingju-content h3, .chengyu-content h3 {
        font-size: 12px;
    }
    
    .mingju-meta, .chengyu-meta {
        font-size: 9px;
    }
    
    .chengyu-desc {
        font-size: 10px;
    }
    
    .topic-tags {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .tag-link {
        font-size: 9px;
        padding: 2px 3px;
    }
    
    .zidian-grid, .cidian-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }
    
    .char, .word {
        font-size: 11px;
    }
    
    .pinyin {
        font-size: 8px;
    }
} 