/**
 * 雕络文学网 - 移动端专用样式
 * 包含：触摸优化、极小屏幕适配、移动端组件覆盖
 */

/* ==================== 移动端基础变量覆盖 ==================== */
@media (max-width: 767px) {
    :root {
        /* 移动端间距调整 */
        --spacing-xl: 32px;
        --spacing-lg: 20px;
        --spacing-md: 16px;
        --spacing-sm: 12px;
        --spacing-xs: 8px;
    }
}

/* ==================== 移动端头部 ==================== */
@media (max-width: 767px) {
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--bg-card);
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    .main {
        padding-top: calc(var(--spacing-lg) * 4);
    }
}

/* ==================== 移动端抽屉菜单动画 ==================== */
@media (max-width: 767px) {
    /* 菜单容器 - z-index 高于顶部栏 */
    .mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 10001;
        visibility: hidden;
        pointer-events: none;
    }
    
    .mobile-menu.active {
        visibility: visible;
        pointer-events: auto;
    }
    
    /* 遮罩层 */
    .mobile-menu-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    
    .mobile-menu.active .mobile-menu-overlay {
        opacity: 1;
    }
    
    /* 菜单面板 - 从右侧滑入 */
    .mobile-menu-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: var(--bg-card);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu.active .mobile-menu-panel {
        transform: translateX(0);
    }
    
    /* 搜索框样式 - 按钮在输入框内部 */
    .mobile-search-form {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .mobile-search-input {
        width: 100%;
        padding: 10px 70px 10px 12px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        font-size: 14px;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
    }
    
    .mobile-search-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(139, 37, 0, 0.1);
    }
    
    .mobile-search-input::placeholder {
        color: var(--text-muted);
    }
    
    .mobile-search-btn {
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        padding: 6px 12px;
        border-radius: 6px;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.2s, opacity 0.2s;
    }
    
    .mobile-search-btn:hover {
        opacity: 0.9;
    }
    
    .mobile-search-btn:active {
        transform: translateY(-50%) scale(0.98);
    }
    
    /* 移动端菜单导航区域 */
    #mobileNavContent {
        padding: 8px 0 !important;
    }
    
    #mobileNavContent .nav-dropdown {
        margin-bottom: 4px;
    }
    
    #mobileNavContent .nav-dropdown > a {
        display: block !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        color: var(--ink-color) !important;
        font-weight: 500 !important;
        font-size: 15px !important;
        text-decoration: none !important;
        position: relative !important;
        transition: background 0.2s;
    }
    
    #mobileNavContent .nav-dropdown > a:hover {
        background: var(--bg-light);
    }
    
    /* 移除原有的 ::after 箭头 */
    #mobileNavContent .nav-dropdown > a::after {
        display: none !important;
    }
    
    /* 展开箭头按钮 */
    #mobileNavContent .nav-dropdown .expand-arrow {
        position: absolute !important;
        right: 12px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        transition: transform 0.2s !important;
        font-size: 12px !important;
        color: var(--text-muted) !important;
        pointer-events: none;
    }
    
    /* 子菜单样式 */
    #mobileNavContent .nav-dropdown-menu {
        display: none !important;
        padding-left: 12px !important;
        margin-top: 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        position: static !important;
    }
    
    #mobileNavContent .nav-dropdown-menu a {
        display: block !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
        color: var(--text-secondary) !important;
        text-decoration: none !important;
        border-radius: 8px !important;
        transition: background 0.2s;
    }
    
    #mobileNavContent .nav-dropdown-menu a:hover {
        background: var(--bg-light);
        color: var(--primary-color) !important;
    }
    
    /* 普通链接样式 */
    #mobileNavContent > a {
        display: block !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        color: var(--ink-color) !important;
        font-size: 15px !important;
        text-decoration: none !important;
        transition: background 0.2s;
    }
    
    #mobileNavContent > a:hover {
        background: var(--bg-light);
    }
}

/* ==================== 触摸优化 ==================== */
@media (max-width: 767px) {
    /* 增大触摸目标 - 所有可点击元素 */
    a, button, .btn {
        /* min-height: 44px;
        min-width: 44px; */
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 移除部分元素的最小尺寸限制 */
    a.icon-btn,
    .icon-btn,
    .mobile-menu-close,
    .mobile-menu-btn,
    .tab-btn {
        min-height: 36px;
        min-width: 36px;
    }
    
    /* 触摸友好的下拉箭头 */
    .nav-dropdown > a,
    .user-trigger {
        padding-right: 20px;
    }
}

/* ==================== 移动端字体大小 ==================== */
@media (max-width: 767px) {
    body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    
    /* Logo缩小 */
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* ==================== 移动端容器 ==================== */
@media (max-width: 767px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .container-narrow {
        padding: 0 var(--spacing-sm);
    }
}

/* ==================== 移动端Hero区域 ==================== */
@media (max-width: 767px) {
    .hero-section {
        margin: 0 calc(-1 * var(--spacing-sm));
        padding: 0 var(--spacing-sm);
    }
    
    .hero-banner {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    .hero-content p {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== 移动端章节区块 ==================== */
@media (max-width: 767px) {
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.125rem;
    }
    
    .section-more {
        font-size: 13px;
    }
}

/* ==================== 移动端文章卡片 ==================== */
@media (max-width: 767px) {
    .article-card {
        margin: 0 0 var(--spacing-md) 0;
        border-radius: var(--radius-md);
        box-shadow: 0 1px 3px rgba(0,0,0,0.06),
                    0 4px 12px rgba(0,0,0,0.04);
        border: 1px solid var(--border-light);
        overflow: hidden;
        /* 移动端禁用悬停动画 */
        transition: none;
    }
    
    .article-card:hover {
        transform: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06),
                    0 4px 12px rgba(0,0,0,0.04);
    }
    
    .article-card .cover {
        height: 160px;
        border-radius: 0;
    }
    
    .article-card .cover img {
        transition: none;
    }
    
    .article-card .info {
        padding: var(--spacing-sm);
    }
    
    .article-card h3 {
        font-size: 15px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .article-card .summary {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .article-card .category {
        font-size: 12px;
    }
    
    .article-card .meta {
        font-size: 12px;
    }
}

/* 移动端图书卡片 */
@media (max-width: 767px) {
    .book-card {
        margin-bottom: var(--spacing-sm);
        border-radius: var(--radius-md);
        box-shadow: 0 1px 3px rgba(0,0,0,0.06),
                    0 4px 12px rgba(0,0,0,0.04);
        border: 1px solid var(--border-light);
        overflow: hidden;
        transition: none;
    }
    
    .book-card:hover {
        transform: none;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06),
                    0 4px 12px rgba(0,0,0,0.04);
    }
    
    .book-card .cover {
        height: 180px;
    }
    
    .book-card .cover img {
        transition: none;
    }
}

/* ==================== 移动端文章列表页（带封面图） ==================== */
@media (max-width: 767px) {
    .article-list-page {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .article-item-full {
        display: flex;
        flex-direction: column;
        padding: var(--spacing-sm);
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
        margin-bottom: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    
    .article-item-full .cover {
        width: 100%;
        height: 160px;
        border-radius: var(--radius-sm);
        margin-bottom: var(--spacing-sm);
        overflow: hidden;
        flex-shrink: 0;
    }
    
    .article-item-full .cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .article-item-full .content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .article-item-full h2 {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: var(--spacing-xs);
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .article-item-full h2 .tag-top,
    .article-item-full h2 .tag-featured {
        display: inline-block;
        font-size: 10px;
        padding: 1px 4px;
        margin-right: 0;
        flex-shrink: 0;
    }
    
    .article-item-full h2 a {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .article-item-full .meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 12px;
        font-size: 12px;
        color: var(--text-light);
        margin-bottom: var(--spacing-xs);
    }
    
    .article-item-full .meta .author {
        color: var(--primary-color);
    }
    
    .article-item-full .summary {
        font-size: 13px;
        color: var(--text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.5;
    }
}

/* iPhone 12 Pro 等中等宽度屏幕 (390px-428px) */
@media (max-width: 428px) {
    .article-item-full {
        padding: var(--spacing-xs);
    }
    
    .article-item-full .cover {
        height: 140px;
    }
    
    .article-item-full h2 {
        font-size: 14px;
    }
    
    .article-item-full .meta {
        font-size: 11px;
        gap: 4px 8px;
    }
}

/* ==================== 移动端两栏布局（侧边栏） ==================== */
@media (max-width: 991px) {
    .two-column {
        flex-direction: column;
    }
    
    .two-column .sidebar {
        width: 100%;
        margin-top: var(--spacing-lg);
    }
}

@media (max-width: 767px) {
    .two-column .sidebar {
        margin-top: var(--spacing-md);
    }
}

/* ==================== 移动端侧边栏组件 ==================== */
@media (max-width: 767px) {
    .widget {
        margin-bottom: var(--spacing-sm);
    }
    
    .widget-header {
        padding: var(--spacing-sm);
    }
    
    .widget-title {
        font-size: 15px;
    }
    
    .widget-body {
        padding: var(--spacing-sm);
    }
    
    /* 热门阅读列表 */
    .hot-list li {
        padding: var(--spacing-sm) 0;
    }
    
    .hot-list .rank {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .hot-list .info a {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .hot-list .views {
        font-size: 12px;
    }
    
    /* 作者列表 - 改为2列网格布局 */
    .author-list-widget {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .author-list-widget li {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--spacing-sm);
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
    }
    
    .author-list-widget li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
    }
    
    .author-list-widget .avatar {
        width: 56px;
        height: 56px;
        margin-bottom: var(--spacing-xs);
        flex-shrink: 0;
    }
    
    .author-list-widget .info {
        width: 100%;
    }
    
    .author-list-widget .name {
        font-size: 13px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .author-list-widget .stats {
        font-size: 11px;
    }
}

/* ==================== 移动端图书网格 ==================== */
@media (max-width: 767px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .book-card .cover {
        height: 180px;
    }
    
    .book-card .cover img {
        transition: none;
    }
}

/* ==================== 移动端Footer ==================== */
@media (max-width: 767px) {
    .footer {
        padding: var(--spacing-lg) 0;
    }
    
    .footer-bottom {
        padding: 0;
        margin-top: 0;
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* ==================== 移动端底部导航栏（可选） ==================== */
@media (max-width: 767px) {
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        z-index: 100;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    
    .mobile-nav-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: var(--text-muted);
        min-height: 44px;
        justify-content: center;
        text-decoration: none;
    }
    
    .mobile-nav-bar a.active,
    .mobile-nav-bar a:hover {
        color: var(--primary-color);
    }
    
    .mobile-nav-bar svg {
        width: 22px;
        height: 22px;
    }
    
    /* 为底部导航留出空间 */
    body.has-mobile-nav .main {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* ==================== 移动端表单优化 ==================== */
@media (max-width: 767px) {
    input, textarea, select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="search"],
    textarea {
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    
    .form-row {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .form-row .form-group {
        width: 100%;
    }
}

/* ==================== 移动端分页 ==================== */
@media (max-width: 767px) {
    .pagination {
        gap: 4px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ==================== 移动端弹窗/模态框 ==================== */
@media (max-width: 767px) {
    .modal-content {
        margin: var(--spacing-sm);
        border-radius: var(--radius-md);
    }
    
    .modal-header {
        padding: var(--spacing-md);
    }
    
    .modal-body {
        padding: var(--spacing-md);
    }
    
    .modal-footer {
        padding: var(--spacing-md);
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ==================== 极小屏幕优化 (iPhone SE 等) ==================== */
@media (max-width: 374px) {
    .container {
        padding: 0 12px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .hero-content h1 {
        font-size: 1.375rem;
    }
    
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .article-card h3 {
        font-size: 14px;
    }
}

/* ==================== 安全区域适配 (iPhone X 及以上) ==================== */
@supports (padding: max(0px)) {
    .mobile-header {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ==================== 移动端滚动优化 ==================== */
@media (max-width: 767px) {
    /* 横向滚动容器 */
    .horizontal-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .horizontal-scroll::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    /* 弹性滚动 */
    .overscroll-contain {
        overscroll-behavior: contain;
    }
}

/* ==================== 移动端图片优化 ==================== */
@media (max-width: 767px) {
    img {
        /* 防止图片超出容器 */
        max-width: 100%;
        height: auto;
    }
    
    /* 封面图统一比例 */
    .cover-square img,
    .cover-rect img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ==================== 移动端文章详情页 ==================== */
@media (max-width: 767px) {
    .article-page {
        padding: 0;
    }
    
    /* 文章内容区域 - 单列布局，正文优先 */
    .article-card {
        background: var(--bg-card);
        margin-bottom: var(--spacing-md);
    }
    
    /* 面包屑导航 - 修复分隔符对齐 */
    .breadcrumb {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
        font-size: 12px;
        margin-bottom: 12px;
        padding: 8px 0;
        color: var(--text-muted);
    }
    
    .breadcrumb a {
        color: var(--text-secondary);
        text-decoration: none;
        flex-shrink: 0;
    }
    
    .breadcrumb a:hover {
        color: var(--primary-color);
    }
    
    .breadcrumb .separator {
        color: var(--text-light);
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        font-size: 12px;
        line-height: 1;
    }
    
    /* 文章头部 - 标题居中 */
    .article-header {
        padding: var(--spacing-md);
        background: var(--bg-card);
        /* border-bottom: 1px solid var(--border-light); */
    }
    
    .article-header h1 {
        font-size: 20px;
        line-height: 1.5;
        text-align: center;
        letter-spacing: 0.02em;
        margin-bottom: var(--spacing-sm);
        color: var(--text-primary);
    }
    
    .article-header .subtitle {
        font-size: 15px;
        text-align: center;
        color: var(--text-secondary);
        margin-bottom: var(--spacing-md);
    }
    
    /* 文章元信息 - 修复作者笔名和图标对齐 */
    .article-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 16px;
        font-size: 12px;
        color: var(--text-muted);
        padding: var(--spacing-sm) 0;
        border-top: 1px solid var(--border-light);
        border-bottom: 1px solid var(--border-light);
    }
    
    .article-meta .meta-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
    }
    
    .article-meta .meta-item svg,
    .article-meta .meta-item i {
        width: 14px;
        height: 14px;
        opacity: 0.6;
        flex-shrink: 0;
    }
    
    .article-meta .meta-item a {
        color: var(--primary-color);
        font-weight: 500;
    }
    
    .article-meta .author-badges {
        display: inline-flex;
        gap: 2px;
        vertical-align: middle;
    }
    
    .article-meta .author-badges img {
        width: 14px;
        height: 14px;
    }
    
    .original-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-top: var(--spacing-sm);
        padding: 8px 12px;
        font-size: 12px;
        color: var(--text-secondary);
        background: var(--bg-cream);
        border-radius: var(--radius-sm);
    }
    
    .original-badge svg,
    .original-badge i {
        width: 14px;
        height: 14px;
        opacity: 0.6;
    }
    
    /* 文章正文 */
    .article-body {
        /* padding: var(--spacing-md); */
        font-size: 15px;
        line-height: 1.8;
        color: var(--text-primary);
    }
    
    .article-body p {
        text-indent: 2em;
        margin-bottom: 1.2em;
    }
    
    .article-body h2 {
        font-size: 18px;
        padding-left: 12px;
        border-left: 3px solid var(--primary-color);
        margin: 1.5em 0 0.8em;
        color: var(--text-primary);
    }
    
    .article-body h3 {
        font-size: 16px;
        color: var(--text-primary);
        margin: 1.2em 0 0.6em;
    }
    
    .article-body blockquote {
        padding: var(--spacing-sm);
        margin: 1.2em 0;
        border-left: 3px solid var(--primary-color);
        background: var(--bg-cream);
    }
    
    /* 文章底部 */
    .article-footer {
        padding: var(--spacing-md);
        border-top: 1px solid var(--border-light);
    }
    
    .article-tags {
        margin-bottom: var(--spacing-md);
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .article-tags .tag {
        padding: 4px 10px;
        font-size: 12px;
        color: var(--text-secondary);
        background: var(--bg-cream);
        border-radius: var(--radius-sm);
        text-decoration: none;
    }
    
    .article-tags .tag:hover {
        background: var(--primary-color);
        color: white;
    }
    
    .article-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1 1 calc(50% - 4px);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 12px 16px;
        font-size: 14px;
        color: var(--text-secondary);
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        text-decoration: none;
        cursor: pointer;
    }
    
    .action-btn svg,
    .action-btn i {
        width: 18px;
        height: 18px;
    }
    
    .action-btn:hover {
        background: var(--bg-cream);
    }
    
    .action-btn.active {
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    
    /* 侧边栏 - 相关推荐和作者信息在正文之后 */
    .article-sidebar {
        margin-top: var(--spacing-md);
    }
    
    .related-card {
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
        margin-bottom: var(--spacing-md);
        overflow: hidden;
    }
    
    .related-card .card-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-cream);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .related-card .card-header i,
    .related-card .card-header svg {
        width: 16px;
        height: 16px;
        opacity: 0.7;
    }
    
    .related-card .card-body {
        padding: var(--spacing-sm);
    }
    
    .related-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .related-list li {
        padding: var(--spacing-sm);
        border-bottom: 1px solid var(--border-light);
    }
    
    .related-list li:last-child {
        border-bottom: none;
    }
    
    .related-list li a {
        display: block;
        font-size: 14px;
        color: var(--text-primary);
        text-decoration: none;
        line-height: 1.4;
        margin-bottom: 4px;
    }
    
    .related-list li a:hover {
        color: var(--primary-color);
    }
    
    .related-list li .meta {
        font-size: 12px;
        color: var(--text-muted);
    }
    
    /* 作者卡片 */
    .author-card {
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .author-card-header {
        display: flex;
        align-items: flex-start;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .author-card .author-avatar {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .author-card .author-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .author-card .author-avatar .no-avatar {
        color: white;
        font-size: 20px;
        font-weight: 600;
    }
    
    .author-card .author-info {
        flex: 1;
        min-width: 0;
    }
    
    .author-card .author-name {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .author-card .author-name a {
        color: inherit;
        text-decoration: none;
    }
    
    .author-card .author-badges {
        display: inline-flex;
        gap: 2px;
    }
    
    .author-card .author-badges img {
        width: 16px;
        height: 16px;
    }
    
    .author-card .author-bio {
        font-size: 13px;
        color: var(--text-muted);
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .author-card .author-stats {
        display: flex;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) 0;
        border-top: 1px solid var(--border-light);
        margin-top: var(--spacing-sm);
    }
    
    .author-card .stat-item {
        text-align: center;
        flex: 1;
    }
    
    .author-card .stat-item .num {
        font-size: 18px;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    .author-card .stat-item .label {
        font-size: 12px;
        color: var(--text-muted);
    }
    
    .author-card .btn-follow {
        display: block;
        width: 100%;
        padding: 10px;
        text-align: center;
        font-size: 14px;
        color: white;
        background: var(--primary-color);
        border-radius: var(--radius-md);
        text-decoration: none;
        margin-top: var(--spacing-sm);
    }
    
    .author-card .btn-follow:hover {
        background: var(--primary-dark);
    }
    
    /* 评论区 */
    .comments-card {
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-light);
        margin-top: var(--spacing-md);
        overflow: hidden;
    }
    
    .comments-card .card-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-light);
        background: var(--bg-cream);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .comments-card .card-header i {
        width: 16px;
        height: 16px;
        opacity: 0.7;
    }
    
    .comments-card .card-body {
        padding: var(--spacing-md);
    }
    
    /* 阅读设置面板在移动端 */
    .reading-fab {
        right: 16px;
        bottom: 20px;
        width: 44px;
        height: 44px;
        opacity: 0.9;
    }
    
    .reading-panel {
        right: 16px;
        bottom: 80px;
        left: 16px;
        width: auto;
        padding: var(--spacing-md);
    }
}

/* ==================== 移动端分类/标签页 ==================== */
@media (max-width: 767px) {
    .category-header {
        padding: var(--spacing-md) 0;
    }
    
    .category-header h1 {
        font-size: 1.25rem;
    }
    
    .category-header .description {
        font-size: 13px;
    }
    
    .filter-tags {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--spacing-xs);
    }
    
    .filter-tags .tag {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 13px;
    }
}

/* ==================== 移动端搜索页 ==================== */
@media (max-width: 767px) {
    .search-header {
        padding: var(--spacing-md) 0;
    }
    
    .search-input-wrapper {
        position: relative;
    }
    
    .search-input-wrapper input {
        width: 100%;
        padding: 12px 40px 12px 16px;
        font-size: 15px;
    }
    
    .search-input-wrapper .search-btn {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .search-results .result-item {
        padding: var(--spacing-sm) 0;
    }
}

/* ==================== 移动端用户中心 ==================== */
@media (max-width: 767px) {
    .user-profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .user-profile-header .avatar {
        width: 80px;
        height: 80px;
    }
    
    .user-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-menu-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xs);
    }
    
    .user-menu-grid .menu-item {
        padding: var(--spacing-sm);
        text-align: center;
    }
    
    .user-menu-grid .menu-item .icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .user-menu-grid .menu-item .text {
        font-size: 12px;
    }
}

/* ==================== 隐藏PC端特定元素 ==================== */
@media (max-width: 767px) {
    .pc-only {
        display: none !important;
    }
}

/* ==================== 显示移动端特定元素 ==================== */
@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}

/* ==================== 骨架屏样式 ==================== */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-cream) 25%,
        var(--bg-paper) 50%,
        var(--bg-cream) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16/9;
}

/* ==================== 空状态组件 ==================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.7;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-serif);
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.empty-state .btn {
    margin-top: var(--spacing-sm);
}

/* 空状态变体 - 无内容 */
.empty-state-no-content .empty-state-icon {
    color: var(--text-muted);
}

/* 空状态变体 - 无搜索结果 */
.empty-state-no-result .empty-state-icon {
    color: var(--primary-color);
    opacity: 0.6;
}

/* 空状态变体 - 网络错误 */
.empty-state-error .empty-state-icon {
    color: #e74c3c;
}

/* ==================== 文章详情页移动端样式 ==================== */
@media (max-width: 767px) {
    /* 面包屑导航 */
    .article-header .breadcrumb {
        font-size: 12px;
        gap: 4px;
        margin-bottom: 16px;
        justify-content: flex-start;
    }
    
    /* 文章元信息 - 紧凑排列 */
    .article-header .article-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 10px 14px;
        font-size: 12px;
        padding: 8px 0;
    }
    
    .article-header .article-meta .meta-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        min-height: auto;
    }
    
    .article-header .article-meta .meta-item svg,
    .article-header .article-meta .meta-item i {
        width: 13px;
        height: 13px;
        opacity: 0.5;
        flex-shrink: 0;
    }
    
    .article-header .article-meta .meta-item a {
        color: var(--primary-color);
        font-weight: 500;
    }
    
    /* 作者笔名图标 */
    .article-header .article-meta .meta-item.author-name {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    
    .article-header .article-meta .meta-item.author-name::before {
        content: '';
        display: inline-block;
        width: 14px;
        height: 14px;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    /* 互动按钮 - 横向一行显示 */
    .article-footer .article-actions {
        display: flex;
        flex-direction: row;
        gap: 8px;
    }
    
    .article-footer .article-actions .action-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
        min-height: auto;
        min-width: auto;
    }
    
    .article-footer .article-actions .action-btn svg,
    .article-footer .article-actions .action-btn i {
        width: 15px;
        height: 15px;
    }
    
    /* 侧边栏作者卡片 */
    .sidebar-author-card .author-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .sidebar-author-card .author-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .sidebar-author-card .author-name {
        justify-content: center;
    }
    
    .sidebar-author-card .author-bio {
        text-align: center;
    }
}
