/**
 * mobile.css - 手机端 APP 样式
 * 底部导航栏 + Tab 切换
 * 断点: max-width: 768px (平板/手机) / max-width: 480px (手机)
 */

/* ==============================
   平板 & 手机 (≤768px)
   ============================== */
@media (max-width: 768px) {
    /* ----- 基础变量 ----- */
    :root {
        --gap: 12px;
        --header-height: 56px;
    }

    body {
        font-size: 15px;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    a, button, .icon-btn, .sort-tab, .load-more-btn,
    .mobile-nav-item, .mobile-cat-item, .mobile-page-card,
    .mobile-friend-item, .mobile-hot-item, .mob-action-btn {
        -webkit-user-select: auto;
        user-select: auto;
        -webkit-tap-highlight-color: rgba(14, 165, 233, 0.1);
    }

    /* ----- 主容器 ----- */
    .container {
        padding: 0 12px;
    }

    .main-wrapper {
        padding-top: calc(var(--header-height) + 12px) !important;
        padding-bottom: 20px;
        gap: 16px;
    }

    /* 隐藏桌面侧边栏 */
    .sidebar {
        display: none !important;
    }

    /* content-single 独立页面 */
    .content-single {
        padding: 0;
    }

    /* ----- 底部导航栏 ----- */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        z-index: 200;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.65rem;
        transition: color 0.2s ease;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item.active {
        color: var(--accent-primary);
    }

    .mobile-nav-item.active svg {
        transform: scale(1.1);
    }

    .mobile-nav-item:active {
        transform: scale(0.95);
    }

    /* 导航栏顶部高光线 */
    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 2px;
        background: var(--accent-gradient);
        border-radius: 1px;
    }

    /* 页面底部预留导航栏空间 */
    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    /* ----- Tab 内容容器 ----- */
    .mobile-tab-content {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 56px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-primary);
        z-index: 150;
    }

    .mobile-tab-inner {
        padding: 12px;
        padding-bottom: 20px;
    }

    /* 移动端分类网格 */
    .mobile-cat-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .mobile-cat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .mobile-cat-item:active {
        transform: scale(0.97);
    }

    .mobile-cat-name {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .mobile-cat-count {
        font-size: 0.75rem;
        color: var(--text-muted);
        background: var(--bg-primary);
        padding: 2px 8px;
        border-radius: var(--radius-full);
    }

    /* 移动端排序标签 */
    .mobile-sort-tabs {
        margin: 12px 0 14px;
    }

    /* 移动端文章列表 */
    .mobile-post-list .post-card {
        flex-direction: row;
        height: auto;
        border-radius: var(--radius-md);
        margin-bottom: 10px;
    }

    .mobile-post-list .post-card-cover-wrap {
        padding: 0;
        flex-shrink: 0;
        width: 110px;
    }

    .mobile-post-list .post-card-cover {
        height: 100%;
        min-height: 90px;
        border-radius: var(--radius-md) 0 0 var(--radius-md);
    }

    .mobile-post-list .post-card-body {
        padding: 10px 12px;
        flex: 1;
        min-width: 0;
    }

    .mobile-post-list .post-card-title {
        font-size: 0.88rem;
        margin-bottom: 3px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
    }

    .mobile-post-list .post-card-tags {
        margin-bottom: 3px;
    }

    .mobile-post-list .post-card-meta {
        padding-top: 6px;
    }

    .mobile-post-list .post-card-stat {
        font-size: 0.7rem;
    }

    .mobile-post-list .post-card-stat svg {
        width: 12px;
        height: 12px;
    }

    /* 移动端 - 更多页 */
    .mobile-more-section {
        margin-bottom: 20px;
    }

    .mobile-section-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        padding-left: 12px;
        border-left: 3px solid var(--accent-primary);
        margin-bottom: 12px;
        line-height: 1.4;
    }

    /* 独立页面卡片 */
    .mobile-page-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mobile-page-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 16px 14px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        text-decoration: none;
        color: var(--text-primary);
        font-size: 0.85rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .mobile-page-card:active {
        transform: scale(0.97);
        background: var(--bg-hover);
    }

    .mobile-page-card svg {
        flex-shrink: 0;
        color: var(--accent-primary);
    }

    /* 友情链接 */
    .mobile-friends-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .mobile-friend-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 16px 8px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        text-decoration: none;
        color: var(--text-primary);
        font-size: 0.78rem;
        transition: all 0.2s ease;
    }

    .mobile-friend-item:active {
        transform: scale(0.97);
    }

    .mobile-friend-item img,
    .mobile-friend-placeholder {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-friend-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--accent-gradient);
        color: #fff;
        font-size: 1.1rem;
        font-weight: 700;
    }

    /* 移动端 - 我的页 */
    .mobile-profile-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        overflow: hidden;
        margin-bottom: 20px;
    }

    .mobile-profile-bg {
        height: 100px;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        position: relative;
    }

    .mobile-profile-avatar {
        position: relative;
        margin-top: -40px;
        text-align: center;
    }

    .mobile-profile-avatar img {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        border: 3px solid var(--bg-secondary);
        box-shadow: var(--shadow-md);
        object-fit: cover;
    }

    .mobile-profile-info {
        text-align: center;
        padding: 12px 16px 0;
    }

    .mobile-profile-name {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 4px;
    }

    .mobile-profile-bio {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin: 0;
        line-height: 1.5;
    }

    .mobile-profile-stats {
        display: flex;
        justify-content: space-around;
        padding: 16px 16px 0;
        margin: 16px 0 0;
        border-top: 1px solid var(--border-color);
    }

    .mobile-profile-stat {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .mob-stat-num {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .mob-stat-label {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    .mobile-profile-actions {
        display: flex;
        gap: 8px;
        padding: 16px;
        justify-content: center;
    }

    .mob-action-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border-radius: var(--radius-full);
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--text-secondary);
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .mob-action-btn:active {
        transform: scale(0.95);
    }

    .mob-action-primary {
        background: var(--accent-gradient);
        color: #fff;
        border-color: transparent;
    }

    /* 移动端热门文章列表 */
    .mobile-hot-list {
        display: flex;
        flex-direction: column;
    }

    .mobile-hot-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        text-decoration: none;
        color: var(--text-primary);
    }

    .mobile-hot-item:last-child {
        border-bottom: none;
    }

    .mobile-hot-item:active {
        opacity: 0.7;
    }

    .mob-hot-rank {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 4px;
        background: var(--bg-primary);
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .mobile-hot-item:nth-child(1) .mob-hot-rank {
        background: linear-gradient(135deg, #f59e0b, #ef4444);
        color: #fff;
    }

    .mobile-hot-item:nth-child(2) .mob-hot-rank {
        background: linear-gradient(135deg, #f59e0b, #f97316);
        color: #fff;
    }

    .mobile-hot-item:nth-child(3) .mob-hot-rank {
        background: linear-gradient(135deg, #f59e0b, #eab308);
        color: #fff;
    }

    .mob-hot-title {
        flex: 1;
        font-size: 0.85rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mob-hot-views {
        font-size: 0.7rem;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    /* 移动端最新评论 */
    .mobile-comment-list {
        display: flex;
        flex-direction: column;
    }

    .mobile-comment-item {
        display: flex;
        gap: 10px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-comment-item:last-child {
        border-bottom: none;
    }

    .mobile-comment-item img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    .mobile-comment-body {
        flex: 1;
        min-width: 0;
    }

    .mobile-comment-author {
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .mobile-comment-text {
        font-size: 0.78rem;
        color: var(--text-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-top: 2px;
    }

    /* ----- 头部导航 ----- */
    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: none;
    }

    .site-header {
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-bottom: none;
    }

    /* 非暗黑模式下（非首页）图标改为黑色，适配浅色背景 */
    body:not(.dark):not(.hero-page) .header-actions .icon-btn {
        color: #1e293b;
    }

    body:not(.dark):not(.hero-page) .header-actions .icon-btn:hover {
        color: #0f172a;
        background: rgba(0, 0, 0, 0.08);
    }

    .header-inner {
        gap: 0;
        justify-content: space-between;
    }

    /* 隐藏网站名称 */
    .logo {
        display: none;
    }

    /* 隐藏发文章按钮和用户下拉 */
    .header-actions .write-post-btn,
    .header-actions .user-dropdown {
        display: none;
    }

    /* 搜索放最左，主题切换放最右 */
    .header-actions {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .header-actions .theme-toggle {
        margin-left: auto;
    }

    /* 隐藏桌面侧边栏（已在上面设置 display: none） */

    /* ----- 首页 Hero 横幅 ----- */
    /* 移动端显示视频源（侧边栏隐藏时无法播放） */
    .hero-video-mobile {
        display: block;
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        object-fit: cover;
        z-index: -1;
        opacity: 0;
    }

    /* 导航栏悬浮在横幅上，全透明 */
    body.hero-page .site-header {
        background: transparent !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        border-bottom: none !important;
    }

    /* 滚动后导航栏半透明 */
    body.hero-page .site-header.scrolled {
        background: rgba(15, 23, 42, 0.5) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
        backdrop-filter: blur(20px) saturate(180%) !important;
    }

    .dark body.hero-page .site-header.scrolled {
        background: rgba(0, 0, 0, 0.5) !important;
    }

    .hero-banner {
        height: 30vh;
        min-height: 180px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-desc {
        font-size: 0.85rem;
    }

    body.hero-page .main-wrapper {
        padding-top: 12px !important;
    }

    /* ----- 首页分类卡片 ----- */
    .cat-cards-section {
        display: none;
    }

    /* 首页推荐文章 - 卡片横向布局 */
    .post-list .post-card {
        flex-direction: row;
        height: auto;
        border-radius: var(--radius-md);
        margin-bottom: 10px;
    }

    .post-list .post-card:last-child {
        margin-bottom: 0;
    }

    .post-card-cover-wrap {
        padding: 0;
        flex-shrink: 0;
        width: 110px;
    }

    .post-card-cover {
        height: 100%;
        min-height: 90px;
        border-radius: var(--radius-md) 0 0 var(--radius-md);
    }

    .post-card-body {
        padding: 10px 12px;
        flex: 1;
        min-width: 0;
    }

    .post-card-title {
        font-size: 0.88rem;
        margin-bottom: 3px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
    }

    .post-card-tags {
        margin-bottom: 3px;
    }

    .post-card-meta {
        padding-top: 6px;
    }

    .post-card-stat {
        font-size: 0.7rem;
    }

    .post-card-stat svg {
        width: 12px;
        height: 12px;
    }

    .post-card-stats {
        gap: 8px;
    }

    /* 隐藏首页"全部文章"区域 */
    .content .sort-tabs,
    .content #articleList,
    .content .load-more-wrap {
        display: none;
    }

    /* 空状态 */
    .empty-state {
        padding: 40px 16px;
    }

    /* ----- 归档横幅 ----- */
    .archive-hero {
        height: 160px;
        margin-bottom: 16px;
        border-radius: var(--radius-md);
    }

    .archive-hero-content {
        padding: 14px 16px;
    }

    .archive-hero-info {
        font-size: 1rem;
        gap: 6px;
    }

    .archive-hero-desc {
        font-size: 0.78rem;
    }

    /* 归档页文章卡片 */
    .archive-hero + .sort-tabs {
        margin: 12px 0 16px;
    }

    .archive-hero + .sort-tabs + .post-list .post-card,
    #archiveList .post-card {
        flex-direction: row;
        height: auto;
        border-radius: var(--radius-md);
        margin-bottom: 10px;
    }

    /* ----- 侧边栏 ----- */
    .sidebar {
        display: none !important;
    }

    /* 移动端侧边栏 */
    .mobile-sidebar {
        width: 260px;
    }

    .mobile-nav a {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    /* ----- 文章页 ----- */
    .joe_detail {
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
    }

    .joe_detail__title {
        font-size: 1.2rem;
        text-align: left;
    }

    .joe_detail__count {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .joe_detail__count-created {
        font-size: 24px;
    }

    .joe_detail__article {
        font-size: 15px;
        padding-top: 12px;
    }

    .joe_detail__article h2 {
        font-size: 1.05rem;
    }

    .joe_detail__article h3 {
        font-size: 0.95rem;
    }

    /* 代码块 */
    .joe_detail__article pre[class*='language-'] {
        margin-left: -12px;
        margin-right: -12px;
        border-radius: 0;
    }

    .joe_detail__article pre[class*='language-'] code[class*='language-'] {
        padding: 0 12px 12px;
    }

    /* 表格 */
    .joe_detail__article table {
        display: block;
        overflow-x: auto;
    }

    /* 视频播放器 */
    .joe_detail__article-video .play .box iframe {
        height: 220px;
    }

    .joe_detail__article-video .episodes .box {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    /* 相关文章 */
    .joe_detail__related-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .joe_detail__related-content .item img {
        height: 80px;
    }

    .joe_detail__related-content .item h6 {
        font-size: 0.75rem;
        height: 28px;
        line-height: 28px;
    }

    /* 下载卡片 */
    .download-card {
        padding: 16px;
        margin: 20px 0;
        border-radius: var(--radius-md);
    }

    .payment-methods {
        flex-direction: column;
        gap: 8px;
    }

    .pay-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .unlock-form {
        flex-direction: column;
        gap: 8px;
    }

    /* 上下篇导航 */
    .joe_post__pagination {
        flex-direction: column;
        gap: 8px;
    }

    .joe_post__pagination-item {
        margin-bottom: 0;
    }

    .joe_post__pagination-item a {
        font-size: 0.8rem;
        height: 36px;
        line-height: 36px;
    }

    /* 百度收录标记 */
    .baidu-record {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    /* 版权 */
    .joe_detail__copyright .content {
        padding: 12px;
        font-size: 0.85rem;
    }

    /* ----- 评论区 ----- */
    .joe_comment {
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
    }

    .joe_comment__title {
        font-size: 18px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .joe_comment .comment-list__item-contain .avatar {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }

    .joe_comment .comment-list__item-contain .term {
        gap: 10px;
    }

    .joe_comment .comment-list__item-contain .content .substance {
        font-size: 14px;
        padding: 10px 12px;
    }

    .joe_comment .comment-list__item-contain .content .user .agent {
        display: none;
    }

    .joe_comment .comment-list__item-contain .content .user .author {
        font-size: 13px;
    }

    .joe_comment .comment-list__item-children {
        padding-left: 28px;
    }

    .joe_comment .comment-list__item .joe_comment__respond {
        margin-left: 0;
    }

    /* 评论表单 */
    .joe_comment__respond-form .head {
        flex-direction: column;
    }

    .joe_comment__respond-form .head .list {
        width: 100%;
        border-bottom: 1px solid var(--border-color, #e8e8e8);
    }

    .joe_comment__respond-form .head .list:last-child {
        border-bottom: none;
    }

    .joe_comment__respond-form .head .list:nth-child(2)::before,
    .joe_comment__respond-form .head .list:nth-child(2)::after {
        display: none;
    }

    /* 表情面板 */
    .joe_owo__contain .box .scroll .item {
        width: calc(100% / 8);
    }

    /* 评论分页 */
    .joe_pagination {
        gap: 6px;
    }

    .joe_pagination a,
    .joe_pagination span {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 0 8px;
    }

    /* ----- 独立页面 ----- */
    .page-header {
        padding: 24px 16px;
        margin-bottom: 24px;
        border-radius: var(--radius-md);
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    /* 友情链接 */
    .friends-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .friend-card {
        padding: 14px;
    }

    .friend-avatar img,
    .friend-avatar-placeholder {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    /* 留言板 */
    .leaving-card {
        padding: 14px;
        gap: 12px;
        margin-bottom: 12px;
        border-radius: var(--radius-md);
    }

    .leaving-card-avatar img {
        width: 40px;
        height: 40px;
    }

    /* 视频搜索 */
    .video-search {
        flex-direction: column;
    }

    .video-search-input {
        width: 100%;
    }

    /* 统计页 */
    .census-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .census-stat-card {
        padding: 16px 10px;
    }

    .census-stat-num {
        font-size: 1.4rem;
    }

    .census-bars {
        padding: 16px;
    }

    .census-bar-name {
        font-size: 0.8rem;
        min-width: 60px;
    }

    .census-list {
        padding: 0 16px;
    }

    /* 404 */
    .error-page {
        padding: 60px 16px;
    }

    .error-code {
        font-size: 4rem;
    }

    /* ----- 表单 ----- */
    .form-input,
    .form-textarea {
        padding: 10px 14px;
        font-size: 15px; /* 防止 iOS 缩放 */
    }

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* ----- 面包屑 ----- */
    .joe_bread {
        padding-top: 8px;
    }

    .joe_bread__bread {
        font-size: 0.8rem;
    }

    /* 隐藏文章页过期警告动画 */
    .joe_detail__overdue-wrapper {
        -webkit-animation: none;
        animation: none;
    }

    .joe_detail__overdue-wrapper:hover {
        clip-path: none;
    }

    /* 点赞按钮 */
    .joe_detail__agree .agree .icon {
        width: 38px;
        height: 38px;
    }

    .joe_detail__agree .agree .icon svg {
        width: 24px;
        height: 24px;
    }

    /* 标签栏 */
    .joe_detail__operate-tags a {
        font-size: 11px;
        padding-right: 6px;
        padding-left: 25px;
        height: 24px;
        line-height: 24px;
        max-width: 100px;
    }

    /* 灯箱 */
    .lightbox-close {
        width: 38px;
        height: 38px;
        top: 12px;
        right: 12px;
    }

    /* ----- 搜索下拉 ----- */
    .search-dropdown .container {
        padding: 0 12px;
    }

    .search-form-inline {
        padding: 10px 0 8px;
    }

    .search-submit-inline {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .search-hot-tags {
        gap: 6px;
    }

    .search-hot-tag {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    /* ----- 用户下拉菜单 ----- */
    .user-dropdown .dropdown-menu {
        right: -8px;
        min-width: 160px;
    }

    /* ----- 加载更多 ----- */
    .load-more-btn {
        padding: 8px 24px;
        font-size: 0.8rem;
    }

    .load-more-wrap {
        margin-top: 16px;
        padding: 16px 0;
    }

    /* ----- 排序标签 ----- */
    .sort-tabs {
        margin: 12px 0 16px;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sort-tab {
        padding: 5px 14px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    /* 页脚 */
    .site-footer {
        padding: 20px 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links a {
        font-size: 0.85rem;
    }

    .footer-copy {
        font-size: 0.8rem;
    }

    /* 阅读进度条 */
    .reading-progress {
        height: 2px;
    }
}

/* ==============================
   手机 (≤480px)
   ============================== */
@media (max-width: 480px) {
    :root {
        --gap: 10px;
    }

    .container {
        padding: 0 10px;
    }

    body {
        font-size: 14px;
    }

    /* ----- Hero ----- */
    .hero-banner {
        height: 26vh;
        min-height: 160px;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .hero-desc {
        font-size: 0.8rem;
        margin-bottom: 16px;
    }

    /* ----- 文章卡片 ----- */
    .post-card-cover-wrap {
        width: 95px;
    }

    .post-card-cover {
        min-height: 75px;
        border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    }

    .post-card-body {
        padding: 8px 10px;
    }

    .post-card-title {
        font-size: 0.82rem;
        -webkit-line-clamp: 1;
        margin-bottom: 2px;
    }

    .post-card-tags {
        display: none;
    }

    .post-card-author span {
        font-size: 0.68rem;
    }

    .post-card-stats {
        gap: 6px;
    }

    .post-card-stat {
        font-size: 0.65rem;
    }

    .post-card-stat svg {
        width: 11px;
        height: 11px;
    }

    .post-card-author img {
        width: 20px;
        height: 20px;
    }

    /* ----- 归档横幅 ----- */
    .archive-hero {
        height: 140px;
        margin-bottom: 12px;
        border-radius: var(--radius-sm);
    }

    .archive-hero-content {
        padding: 10px 14px;
    }

    .archive-hero-info {
        font-size: 0.9rem;
    }

    .archive-hero-desc {
        font-size: 0.72rem;
        display: none;
    }

    /* ----- 移动端分类 ----- */
    .mobile-cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .mobile-cat-item {
        padding: 12px 12px;
    }

    .mobile-cat-name {
        font-size: 0.82rem;
    }

    .mobile-cat-count {
        font-size: 0.7rem;
    }

    /* ----- 移动端文章列表 ----- */
    .mobile-post-list .post-card-cover-wrap {
        width: 95px;
    }

    .mobile-post-list .post-card-cover {
        min-height: 75px;
    }

    /* ----- 更多页 ----- */
    .mobile-page-cards {
        grid-template-columns: 1fr;
    }

    .mobile-friends-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .mobile-friend-item {
        padding: 12px 6px;
    }

    .mobile-friend-item img,
    .mobile-friend-placeholder {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .mobile-friend-item span {
        font-size: 0.72rem;
    }

    /* ----- 我的页 ----- */
    .mobile-profile-bg {
        height: 80px;
    }

    .mobile-profile-avatar img {
        width: 64px;
        height: 64px;
    }

    .mobile-profile-name {
        font-size: 0.95rem;
    }

    .mobile-profile-bio {
        font-size: 0.75rem;
    }

    .mob-stat-num {
        font-size: 1.15rem;
    }

    .mob-stat-label {
        font-size: 0.7rem;
    }

    .mobile-profile-actions {
        flex-wrap: wrap;
        padding: 12px;
        gap: 6px;
    }

    .mob-action-btn {
        padding: 7px 14px;
        font-size: 0.75rem;
    }

    /* ----- 文章页 ----- */
    .joe_detail {
        padding: 10px;
    }

    .joe_detail__title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .joe_detail__article {
        font-size: 14.5px;
        line-height: 1.7;
    }

    .joe_detail__article p {
        margin-bottom: 14px;
    }

    .joe_detail__article blockquote {
        padding: 8px 12px;
    }

    .joe_detail__related-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .joe_detail__related-content .item img {
        height: 70px;
    }

    /* 视频 */
    .joe_detail__article-video .play .box iframe {
        height: 180px;
    }

    .joe_detail__article-video .episodes .box {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    /* 过期警告 */
    .joe_detail__overdue-wrapper {
        padding: 12px;
    }

    .joe_detail__overdue-wrapper .content {
        padding-left: 20px;
        font-size: 0.85rem;
    }

    /* 下载卡片 */
    .download-card {
        padding: 14px;
        margin: 16px 0;
    }

    .download-header h3 {
        font-size: 1rem;
    }

    .price {
        font-size: 1.2rem;
    }

    /* 评论区 */
    .joe_comment {
        padding: 10px;
    }

    .joe_comment .comment-list__item-contain .avatar {
        width: 32px;
        height: 32px;
    }

    .joe_comment .comment-list__item-contain .substance {
        font-size: 13px;
        padding: 8px 10px;
    }

    /* 表情面板 */
    .joe_owo__contain .box .scroll .item {
        width: calc(100% / 6);
    }

    /* 独立页面 */
    .page-header {
        padding: 20px 14px;
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 1.15rem;
    }

    /* 友情链接 */
    .friend-card {
        padding: 12px;
        gap: 12px;
    }

    .friend-avatar img,
    .friend-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .friend-name {
        font-size: 0.9rem;
    }

    .friend-desc {
        font-size: 0.8rem;
    }

    /* 留言板 */
    .leaving-card {
        padding: 12px;
    }

    .leaving-card-avatar img {
        width: 36px;
        height: 36px;
    }

    /* 统计页 */
    .census-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .census-stat-card {
        padding: 14px 8px;
    }

    .census-stat-num {
        font-size: 1.2rem;
    }

    .census-stat-label {
        font-size: 0.7rem;
    }

    .census-bars {
        padding: 12px;
    }

    .census-bar {
        gap: 8px;
    }

    .census-bar-name {
        font-size: 0.75rem;
        min-width: 50px;
    }

    /* 壁纸 */
    .wallpaper-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* 视频 */
    .video-grid {
        grid-template-columns: 1fr;
    }

    /* 搜索 */
    .search-dropdown .container {
        padding: 0 10px;
    }

    .search-hot-tags {
        gap: 4px;
    }

    .search-hot-tag {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    /* 页脚 */
    .site-footer {
        padding: 16px 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .footer-links a {
        font-size: 0.8rem;
    }

    .footer-copy {
        font-size: 0.75rem;
    }

    /* 灯箱 */
    .lightbox-overlay img {
        max-width: 100%;
        border-radius: 0;
    }

    .lightbox-caption {
        bottom: 10px;
        font-size: 0.8rem;
        max-width: 90%;
    }
}

/* ==============================
   极小屏 (≤360px)
   ============================== */
@media (max-width: 360px) {
    .hero-banner {
        height: 22vh;
        min-height: 140px;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .post-card-cover-wrap {
        width: 80px;
    }

    .post-card-cover {
        min-height: 65px;
    }

    .mobile-bottom-nav {
        height: 50px;
    }

    .mobile-nav-item {
        font-size: 0.6rem;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }

    body {
        padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-tab-content {
        bottom: 50px;
    }
}
