/* 
 * 光年2099主题 - 移动端样式
 * 文件位置：/assets/css/mobile.css
 */

/* 基础移动端样式 */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.5;
        -webkit-text-size-adjust: 100%;
        overflow-x: hidden;
    }
    
    /* 隐藏桌面端元素 */
    .desktop-only {
        display: none !important;
    }
    
    /* 显示移动端元素 */
    .mobile-only {
        display: block !important;
    }
    
    /* 通用容器优化 */
    .container {
        width: 100%;
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* 头部导航简化 */
    .site-header {
        padding: 10px 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(10, 14, 23, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(64, 156, 255, 0.2);
    }
    
    /* Logo缩小 */
    .site-branding .logo {
        font-size: 1.3rem;
    }
    
    .site-branding .logo i {
        font-size: 1.5rem;
        margin-right: 8px;
    }
    
    /* 移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(64, 196, 255, 0.1);
        border: 1px solid rgba(64, 196, 255, 0.2);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(64, 196, 255, 0.2);
    }
    
    .mobile-menu-toggle i {
        font-size: 1.2rem;
        color: #40c4ff;
    }
    
    /* 移动端菜单样式 */
    .mobile-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(10, 14, 23, 0.98);
        backdrop-filter: blur(20px);
        z-index: 9999;
        padding: 80px 20px 20px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        border-left: 1px solid rgba(64, 156, 255, 0.2);
    }
    
    .mobile-nav.active {
        right: 0;
    }
    
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    .mobile-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .mobile-nav li {
        margin: 0;
        border-bottom: 1px solid rgba(64, 156, 255, 0.1);
    }
    
    .mobile-nav li:last-child {
        border-bottom: none;
    }
    
    .mobile-nav a {
        display: block;
        padding: 15px;
        color: #e0f0ff;
        text-decoration: none;
        font-size: 1.1rem;
        transition: all 0.3s;
    }
    
    .mobile-nav a:hover,
    .mobile-nav .current-menu-item a {
        color: #40c4ff;
        background: rgba(64, 196, 255, 0.1);
    }
    
    .mobile-nav-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(64, 196, 255, 0.1);
        border-radius: 8px;
        cursor: pointer;
    }
    
    .mobile-nav-close i {
        font-size: 1.2rem;
        color: #40c4ff;
    }
    
    /* 英雄区域简化 */
    .hero-section {
        padding: 60px 0;
        height: auto;
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    .hero-description {
        font-size: 1rem;
        padding: 0 10px;
        line-height: 1.6;
    }
    
    /* 内容区域简化 */
    .content-wrapper {
        display: block;
    }
    
    .main-content {
        width: 100%;
        padding: 0;
    }
    
    /* 侧边栏移动端样式 */
    #secondary {
        margin-top: 30px;
        padding: 20px;
        background: rgba(16, 25, 40, 0.8);
        border-radius: 10px;
    }
    
    /* 文章列表简化 */
    .post-item {
        margin-bottom: 20px;
        padding: 20px;
        border-radius: 8px;
        background: rgba(16, 25, 40, 0.7);
    }
    
    .entry-header {
        margin-bottom: 15px;
    }
    
    .post-thumbnail {
        margin-bottom: 15px;
        border-radius: 6px;
        overflow: hidden;
    }
    
    .post-thumbnail img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
    }
    
    .entry-title {
        font-size: 1.3rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .entry-title a {
        color: #e0f0ff;
        text-decoration: none;
    }
    
    .entry-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.85rem;
        color: #a0c0e0;
        margin-bottom: 15px;
    }
    
    .entry-meta i {
        margin-right: 5px;
    }
    
    .entry-content {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #c0e0ff;
    }
    
    /* 简化分页 */
    .posts-pagination {
        margin: 30px 0;
    }
    
    .page-numbers {
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    /* 页脚简化 */
    .site-footer {
        padding: 40px 0 20px;
    }
    
    .footer-content {
        display: block;
    }
    
    .footer-section {
        margin-bottom: 30px;
        padding: 0 10px;
    }
    
    .footer-section:last-child {
        margin-bottom: 0;
    }
    
    .footer-links li {
        margin-bottom: 10px;
    }
    
    /* 备案信息 */
    .icp-info {
        padding: 10px;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* 按钮样式优化 */
    .cta-button,
    .read-more,
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
        min-height: 44px; /* 移动端触摸友好 */
    }
    
    /* 触摸优化 */
    button,
    input,
    select,
    textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 移除不必要的阴影和效果 */
    .feature-card,
    .article-card,
    .story-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: none !important;
    }
    
    /* 简化加载动画 */
    .loading-spinner {
        padding: 40px 20px;
    }
    
    .loading-spinner i {
        font-size: 2rem;
    }
    
    /* 文章页面优化 */
    .single .entry-header {
        padding: 20px 0;
    }
    
    .single .entry-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .single .entry-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .single .entry-content h2 {
        font-size: 1.3rem;
        margin: 1.2em 0 0.8em;
    }
    
    .single .entry-content h3 {
        font-size: 1.2rem;
        margin: 1em 0 0.6em;
    }
    
    /* 评论区域优化 */
    .comments-area {
        margin-top: 30px;
    }
    
    .comment-form {
        padding: 20px;
    }
    
    /* 小工具优化 */
    .widget {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .widget-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    /* 搜索框优化 */
    .search-form {
        display: flex;
    }
    
    .search-form input[type="search"] {
        flex: 1;
        min-height: 44px;
        padding: 0 15px;
        font-size: 16px;
    }
    
    .search-form button {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* ============================================
       文章详情页移动端优化 - 新增部分
       解决边框过窄、文字显示少的问题
    ============================================ */
    
    /* 文章详情页基础优化 */
    .single .site-main,
    .page .site-main {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* 文章内容区域 - 解决边框过窄问题 */
    .single .entry-content,
    .page .entry-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important;  /* 增加左右边距 */
        margin: 0 auto !important;
        box-sizing: border-box;
    }
    
    /* 文章段落文字 - 增加可读性 */
    .single .entry-content p,
    .page .entry-content p {
        max-width: 100% !important;
        width: 100% !important;
        font-size: 17px !important;  /* 稍大字体 */
        line-height: 1.8 !important;  /* 增加行高 */
        margin: 0 auto 1.5em !important;
        padding: 0 5px !important;    /* 段落内边距 */
        text-align: justify;          /* 两端对齐 */
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* 文章标题优化 */
    .single .entry-content h1,
    .single .entry-content h2,
    .single .entry-content h3,
    .single .entry-content h4,
    .single .entry-content h5,
    .single .entry-content h6,
    .page .entry-content h1,
    .page .entry-content h2,
    .page .entry-content h3,
    .page .entry-content h4,
    .page .entry-content h5,
    .page .entry-content h6 {
        padding: 0 15px !important;
        margin: 1.8em auto 1em !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* 文章列表优化 */
    .single .entry-content ul,
    .single .entry-content ol,
    .page .entry-content ul,
    .page .entry-content ol {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 30px !important;
        padding-right: 20px !important;
        margin: 1.5em auto !important;
        box-sizing: border-box;
    }
    
    /* 文章图片优化 */
    .single .entry-content img,
    .page .entry-content img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        display: block;
        margin: 1.5em auto !important;
        padding: 0 10px !important;
        box-sizing: border-box;
        border-radius: 6px;
    }
    
    /* 文章引用块优化 */
    .single .entry-content blockquote,
    .page .entry-content blockquote {
        max-width: 100% !important;
        width: calc(100% - 40px) !important;
        margin: 1.5em 20px !important;
        padding: 20px !important;
        box-sizing: border-box;
        border-left: 4px solid #40c4ff;
        background: rgba(16, 25, 40, 0.3);
        border-radius: 0 8px 8px 0;
    }
    
    /* 文章代码块优化 */
    .single .entry-content pre,
    .single .entry-content code,
    .page .entry-content pre,
    .page .entry-content code {
        max-width: 100% !important;
        width: calc(100% - 40px) !important;
        margin: 1.5em 20px !important;
        padding: 15px !important;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: rgba(16, 25, 40, 0.5);
        border-radius: 6px;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    /* 文章表格优化 */
    .single .entry-content table,
    .page .entry-content table {
        max-width: 100% !important;
        width: 100% !important;
        margin: 1.5em 0 !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    
    .single .entry-content th,
    .single .entry-content td,
    .page .entry-content th,
    .page .entry-content td {
        padding: 12px 15px;
        min-width: 100px;
        border: 1px solid rgba(64, 156, 255, 0.2);
    }
    
    /* 文章视频和嵌入内容 */
    .single .entry-content iframe,
    .single .entry-content video,
    .single .entry-content object,
    .single .entry-content embed,
    .page .entry-content iframe,
    .page .entry-content video,
    .page .entry-content object,
    .page .entry-content embed {
        max-width: 100% !important;
        width: calc(100% - 40px) !important;
        height: auto !important;
        min-height: 200px;
        margin: 1.5em 20px !important;
        display: block;
        box-sizing: border-box;
    }
    
    /* 文章元信息 */
    .single .entry-meta,
    .page .entry-meta {
        padding: 0 20px !important;
        margin: 20px 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* 文章标题区域 */
    .single .entry-title,
    .page .entry-title {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
        padding: 0 20px !important;
        margin: 20px 0 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* 文章导航 */
    .single .post-navigation,
    .page .post-navigation {
        padding: 0 20px !important;
        margin: 30px 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* 相关文章 */
    .single .related-posts,
    .page .related-posts {
        padding: 0 20px !important;
        margin: 30px 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* WordPress画廊 */
    .single .gallery,
    .page .gallery {
        margin: 1.5em 20px !important;
        padding: 0 5px !important;
        max-width: calc(100% - 40px) !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* WordPress栏目 */
    .single .wp-block-columns,
    .page .wp-block-columns {
        margin: 1.5em 20px !important;
        padding: 0 !important;
        max-width: calc(100% - 40px) !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* WordPress按钮 */
    .single .wp-block-button,
    .page .wp-block-button {
        margin: 1.5em 20px !important;
        max-width: calc(100% - 40px) !important;
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* 小屏幕手机优化 (480px以下) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .mobile-nav {
        width: 85%;
    }
    
    /* 网格布局优化 */
    .features-grid,
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 页脚社交图标 */
    .social-links a {
        margin: 0 10px;
        font-size: 1.3rem;
    }
    
    /* ============================================
       小屏幕文章详情页优化
    ============================================ */
    
    /* 文章内容区域 */
    .single .entry-content,
    .page .entry-content {
        padding: 0 15px !important;  /* 小屏幕减少边距 */
    }
    
    /* 文章段落文字 */
    .single .entry-content p,
    .page .entry-content p {
        font-size: 16px !important;  /* 小屏幕字体 */
        line-height: 1.7 !important;  /* 小屏幕行高 */
        padding: 0 3px !important;    /* 减少内边距 */
    }
    
    /* 文章标题 */
    .single .entry-content h1,
    .single .entry-content h2,
    .single .entry-content h3,
    .single .entry-content h4,
    .single .entry-content h5,
    .single .entry-content h6,
    .page .entry-content h1,
    .page .entry-content h2,
    .page .entry-content h3,
    .page .entry-content h4,
    .page .entry-content h5,
    .page .entry-content h6 {
        padding: 0 12px !important;
        margin: 1.6em auto 0.8em !important;
    }
    
    /* 文章标题区域 */
    .single .entry-title,
    .page .entry-title {
        font-size: 1.4rem !important;
        padding: 0 15px !important;
    }
    
    /* 文章引用块 */
    .single .entry-content blockquote,
    .page .entry-content blockquote {
        width: calc(100% - 30px) !important;
        margin: 1.5em 15px !important;
        padding: 15px !important;
    }
    
    /* 文章代码块 */
    .single .entry-content pre,
    .single .entry-content code,
    .page .entry-content pre,
    .page .entry-content code {
        width: calc(100% - 30px) !important;
        margin: 1.5em 15px !important;
        padding: 12px !important;
    }
    
    /* 文章列表 */
    .single .entry-content ul,
    .single .entry-content ol,
    .page .entry-content ul,
    .page .entry-content ol {
        padding-left: 25px !important;
        padding-right: 15px !important;
    }
    
    /* 文章元信息 */
    .single .entry-meta,
    .page .entry-meta {
        padding: 0 15px !important;
    }
    
    /* 文章导航 */
    .single .post-navigation,
    .page .post-navigation {
        padding: 0 15px !important;
    }
    
    /* 相关文章 */
    .single .related-posts,
    .page .related-posts {
        padding: 0 15px !important;
    }
    
    /* 评论区域 */
    .comments-area {
        padding: 0 15px !important;
    }
}

/* 超小屏幕优化 (360px以下) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .entry-title {
        font-size: 1.2rem;
    }
    
    .cta-button {
        width: 100%;
        text-align: center;
    }
    
    .mobile-nav {
        width: 90%;
    }
    
    /* ============================================
       超小屏幕文章详情页优化
    ============================================ */
    
    /* 文章内容区域 */
    .single .entry-content,
    .page .entry-content {
        padding: 0 12px !important;  /* 超小屏幕边距 */
    }
    
    /* 文章段落文字 */
    .single .entry-content p,
    .page .entry-content p {
        font-size: 15px !important;  /* 超小屏幕字体 */
        line-height: 1.65 !important;  /* 超小屏幕行高 */
        padding: 0 2px !important;    /* 最小内边距 */
    }
    
    /* 文章标题 */
    .single .entry-content h1,
    .single .entry-content h2,
    .single .entry-content h3,
    .single .entry-content h4,
    .single .entry-content h5,
    .single .entry-content h6,
    .page .entry-content h1,
    .page .entry-content h2,
    .page .entry-content h3,
    .page .entry-content h4,
    .page .entry-content h5,
    .page .entry-content h6 {
        padding: 0 10px !important;
        margin: 1.4em auto 0.6em !important;
        font-size: 90% !important;  /* 标题稍微缩小 */
    }
    
    /* 文章标题区域 */
    .single .entry-title,
    .page .entry-title {
        font-size: 1.3rem !important;
        padding: 0 12px !important;
    }
    
    /* 文章引用块 */
    .single .entry-content blockquote,
    .page .entry-content blockquote {
        width: calc(100% - 24px) !important;
        margin: 1.5em 12px !important;
        padding: 12px !important;
        font-size: 0.95em !important;
    }
    
    /* 文章代码块 */
    .single .entry-content pre,
    .single .entry-content code,
    .page .entry-content pre,
    .page .entry-content code {
        width: calc(100% - 24px) !important;
        margin: 1.5em 12px !important;
        padding: 10px !important;
        font-size: 0.85rem !important;
    }
    
    /* 文章列表 */
    .single .entry-content ul,
    .single .entry-content ol,
    .page .entry-content ul,
    .page .entry-content ol {
        padding-left: 20px !important;
        padding-right: 12px !important;
    }
    
    /* 文章图片 */
    .single .entry-content img,
    .page .entry-content img {
        padding: 0 5px !important;
        margin: 1.2em auto !important;
    }
    
    /* 文章元信息 */
    .single .entry-meta,
    .page .entry-meta {
        padding: 0 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* 文章导航 */
    .single .post-navigation,
    .page .post-navigation {
        padding: 0 12px !important;
    }
    
    /* 相关文章 */
    .single .related-posts,
    .page .related-posts {
        padding: 0 12px !important;
    }
    
    /* 评论区域 */
    .comments-area {
        padding: 0 12px !important;
    }
    
    /* WordPress画廊 */
    .single .gallery,
    .page .gallery {
        margin: 1.5em 12px !important;
    }
    
    /* WordPress栏目 */
    .single .wp-block-columns,
    .page .wp-block-columns {
        margin: 1.5em 12px !important;
        max-width: calc(100% - 24px) !important;
    }
    
    /* WordPress按钮 */
    .single .wp-block-button,
    .page .wp-block-button {
        margin: 1.5em 12px !important;
        max-width: calc(100% - 24px) !important;
    }
}

/* 防止文章内容溢出 */
@media (max-width: 768px) {
    .entry-content * {
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    
    /* 强制表格换行 */
    .entry-content table {
        word-break: break-all !important;
    }
    
    /* 强制长链接换行 */
    .entry-content a {
        word-break: break-all !important;
    }
}