/* =============================================
   户外暖阳交友主题 — 移动端全适配
   ============================================= */

@media screen and (max-width: 900px) {

/* ===== Base ===== */
body {
    font-size: 15px;
    line-height: 1.6;
    padding-bottom: 56px;
}

.wrapper { padding: 0 14px; }

/* 本地话题标题（移动端） */
.local-topic-heading {
    font-size: 15px;
    padding: 10px 0 4px;
    margin-bottom: 2px;
}

/* ===== 移动端头部 ===== */
.site-header {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-inner {
    height: 52px;
    padding: 0 14px;
    gap: 0;
}

.site-branding .site-title {
    font-size: 20px;
}

.header-right { display: none !important; }

.menu-toggle {
    display: flex !important;
    width: 40px;
    height: 40px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-search-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-content);
    padding: 0;
}

/* 移动端导航菜单 */
.main-navigation {
    order: 3;
    flex: 0 0 auto;
}

.mobile-search-toggle {
    margin-left: auto;
}

.nav-menu {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 8px 16px;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 999;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
}

.nav-menu.active {
    display: flex;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    height: auto;
    line-height: normal;
    padding: 14px 12px;
    color: var(--text-primary) !important;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}

.nav-menu li a::after { display: none; }

.nav-menu li:last-child a { border-bottom: none; }

.nav-menu li.current-menu-item a,
.nav-menu li.current_page_item a {
    color: var(--primary) !important;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

/* 移动端搜索条 */
.mobile-search-bar {
    display: none;
    padding: 0 14px 12px;
}

.mobile-search-bar.active { display: block; }

.mobile-search-bar .search-field {
    width: 100%;
    border: none;
    background: var(--bg);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 15px;
    outline: none;
}

.mobile-search-bar .search-field::placeholder {
    color: var(--text-muted);
}

/* ===== 布局 ===== */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.widget-area-left,
.widget-area-right {
    display: none !important;
}

.site-main { width: 100%; }

/* ===== 快速导航 ===== */
.quick-nav-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 14px;
}

/* ===== 话题卡片 ===== */
.topic-card {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.card-body .title {
    font-size: 17px;
    line-height: 1.5;
}

.card-body .excerpt {
    font-size: 14px;
    line-height: 1.8;
}

.topic-media-grid { gap: 8px; }

.topic-media-grid,
.topic-media-grid.media-count-1,
.topic-media-grid.media-count-3,
.topic-media-grid.media-count-4,
.topic-media-grid.media-count-5,
.topic-media-grid.media-count-6,
.topic-media-grid.media-count-7,
.topic-media-grid.media-count-8,
.topic-media-grid.media-count-9 {
    grid-template-columns: repeat(2, 1fr);
}

.footer-action { padding: 10px 6px; font-size: 13px; }
.footer-action .action-icon { font-size: 14px; }

/* ===== 圈子卡片 ===== */
.circles-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 0;
}

.circle-card a {
    flex-direction: row;
    text-align: left;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.circle-card .circle-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin: 0;
    flex-shrink: 0;
}

.circle-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.circle-card p { font-size: 13px; }

/* ===== 归档页 ===== */
.archive-header {
    padding: 16px;
    gap: 14px;
}

.archive-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 22px;
}

.archive-meta h1 { font-size: 20px; }

/* ===== 详情页 ===== */
.topic-detail-card,
.comments-wrap {
    padding: 18px;
}

.detail-header {
    align-items: flex-start;
    flex-wrap: wrap;
}

.detail-side-tag {
    width: 100%;
    margin-left: 0;
}

.detail-title { font-size: 24px; }

.topic-detail-content {
    overflow-x: hidden;
    word-break: break-word;
}
.topic-detail-content img,
.topic-detail-content iframe,
.topic-detail-content video {
    max-width: 100% !important;
    height: auto !important;
}

.topic-gallery { grid-template-columns: 1fr; }

.detail-action {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    text-align: center;
}

.comments-list-header {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
}

/* ===== 评论 ===== */
.comment-body { gap: 10px; }
.comment-author-line { flex-wrap: wrap; }
.comment-actions {
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== 弹窗 ===== */
.site-panel-content {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ===== 移动端底部导航 ===== */
#mobile-footer-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
}

#mobile-footer-menu a {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    gap: 1px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 12px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#mobile-footer-menu a .mf-icon {
    display: inline;
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s;
}

#mobile-footer-menu a b {
    display: inline;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s;
}

#mobile-footer-menu a:active .mf-icon { transform: scale(1.15); }
#mobile-footer-menu a:active b { color: var(--primary); }

#mobile-footer-menu .mf-publish-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-btn);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

#mobile-footer-menu .mf-publish-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(61, 188, 177, 0.35);
}

#mobile-footer-menu .mf-publish-btn:active { transform: scale(0.96); }

#mobile-footer-menu .mf-publish-btn span {
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    display: block;
}

/* ===== 移动端分类导航 ===== */
.mo-cat-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 14px 20px;
    background: #f5f7fa;
}

.mo-cat-title {
    flex: 0 0 100%;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-align: left;
    line-height: 1.4;
    margin-bottom: 2px;
}

.mo-cat-item {
    flex: 0 0 calc(25% - 8px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 0 0;
    text-decoration: none;
}

.mo-cat-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mo-cat-icon img {
    width: 55px;
    height: 55px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

.mo-cat-label {
    font-size: 12px;
    font-weight: 400;
    color: #444;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 隐藏旧版页脚（只隐藏不带 footer-v2 的 site-footer） */
.site-footer:not(.footer-v2) { display: none; }

/* ===== 手机端圈子跑马灯 ===== */
.hot-tags-marquee {
    overflow: hidden;
    padding: 6px 0;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ht-track {
    display: flex;
    overflow: hidden;
}
.ht-track:nth-child(1) {
    animation: marquee-scroll 23.33s linear infinite;
}
.ht-track:nth-child(2) {
    animation: marquee-scroll 23.33s linear infinite;
    animation-delay: -8s;
}
.ht-content {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex-shrink: 0;
}
.ht-item {
    display: inline-block;
    padding: 3px 8px;
    margin: 0 5px;
    font-size: 13px;
    color: var(--primary, #3DBCB1);
    background: var(--primary-light, #E8F8F6);
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.ht-item strong {
    font-weight: 700;
}
.ht-item:hover {
    background: var(--primary, #3DBCB1);
    color: #fff;
}

/* ===== 个人资料页（移动端—抖音/小红书风格） ===== */
.profile-page {
    padding: 0;
    margin: 0 auto;
    position: relative;
}

/* 移动端编辑按钮 — 固定在右上角，始终可见 */
.mobile-edit-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    position: fixed;
    top: 10px;
    right: 14px;
    z-index: 10001;
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mobile-edit-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}
.mobile-edit-btn svg {
    flex-shrink: 0;
}

.profile-hero {
    min-height: auto;
    padding: 28px 18px 20px;
    border-radius: 20px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #3DBCB1 0%, #2A9D94 50%, #1E8A81 100%);
    color: #fff;
}
.hero-avatar img {
    width: 80px;
    height: 80px;
}
.hero-name { font-size: 20px; }
.hero-bio { font-size: 13px; max-width: 260px; }
.hero-info-tags {
    gap: 6px;
    margin-top: 12px;
}
.hero-info-tag {
    padding: 3px 10px;
    font-size: 11px;
    gap: 4px;
}
.hero-info-tag svg {
    width: 10px;
    height: 10px;
}

/* 统计条 — 小红书风格，封面下方独立卡片 */
.profile-stats-bar {
    margin: -24px 14px 0;
    padding: 16px 10px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff;
}
.stats-num { font-size: 18px; }
.stats-label { font-size: 10px; }
.stats-divider { height: 22px; }

/* 快捷操作 — 小红书风格九宫格入口 */
.profile-shortcuts {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 14px 0;
}
.shortcut-item {
    padding: 14px 8px;
    gap: 8px;
    font-size: 12px;
    border-radius: 14px;
}
.shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}
.shortcut-icon svg { width: 20px; height: 20px; }

.profile-tab-bar {
    margin: 14px 14px 0;
    padding: 3px;
    border-radius: 14px;
}
.profile-tab {
    padding: 12px 10px;
    font-size: 13px;
    gap: 4px;
}
.profile-tab svg { width: 14px; height: 14px; }

.profile-content {
    margin: 10px 14px 0;
}

.topic-simple-item {
    padding: 14px 16px;
}

.bottom-card-body {
    padding: 10px 16px;
}

.profile-bottom-cards {
    margin: 16px 14px;
    gap: 12px;
}

/* ===== 发布面板（移动端） ===== */
.mpp-header {
    padding: 18px 20px;
}

.mpp-header span { font-size: 17px; }

.mpp-body { padding: 20px; }

.mpp-input,
.mpp-textarea,
.mpp-select {
    padding: 12px 14px;
    font-size: 15px;
    border-width: 2px;
}

.mpp-submit-btn {
    padding: 14px;
    font-size: 16px;
}

/* ===== Toast（移动端） ===== */
.toasted {
    top: 66px;
    font-size: 13px;
    padding: 8px 20px;
}

/* ===== 认证弹窗（移动端） ===== */
.mup-body { padding: 24px 20px 28px; }

.mup-submit-btn {
    height: 48px;
    font-size: 15px;
}

.auth-tab-item {
    padding: 16px;
    font-size: 14px;
}

/* ===== 编辑资料页（移动端） ===== */
.ep-avatar-section.box {
    padding: 24px 16px;
    text-align: center;
    background: #f0f2f5;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.ep-avatar-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.08);
}

.ep-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.25s;
}
.ep-avatar-wrap:hover .ep-avatar-overlay { opacity: 1; }

.ep-avatar-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== 热门圈子跑马灯 ===== */
.hot-circles-marquee {
    padding: 8px 12px;
    margin-bottom: 10px;
    gap: 10px;
}
.marquee-label {
    font-size: 12px;
}
.marquee-content {
    animation-duration: 25s;
}
.marquee-item {
    font-size: 12px;
    padding: 3px 8px;
    gap: 4px;
}
.marquee-icon {
    width: 18px;
    height: 18px;
    font-size: 10px;
}

/* ===== 移动端 Hero 横幅 ===== */
.hero-banner {
    padding: 24px 18px;
    margin-bottom: 12px;
}
.hero-banner h2 {
    font-size: 18px;
}
.hero-banner p {
    font-size: 13px;
    margin-bottom: 12px;
}
.hero-stats {
    gap: 14px;
    flex-wrap: wrap;
}
.hero-stat .num {
    font-size: 20px;
}
.hero-stat .label {
    font-size: 11px;
}

/* 定位信息移动端样式 — hero-banner 右上角 */
.hero-banner-location {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    line-height: 1.4;
}

/* ===== 移动端 Footer ===== */
.footer-v2 {
    padding: 14px 0 76px;
    margin-top: 24px;
}
.footer-v2 .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 6px;
}
.footer-stats-row {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
    column-gap: 10px;
}
.stats-label {
    font-size: 12px;
}
.stats-item {
    font-size: 12px;
    gap: 2px;
}
.stats-item em {
    font-size: 13px;
}
.footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 2px;
}
.footer-bottom p {
    font-size: 11px;
}
}
}
} /* end @media 900px */

/* ===== 小屏优化 ===== */
@media screen and (max-width: 480px) {
    .archive-header { padding: 14px; }
    .topic-card { padding: 14px; }
    .detail-title { font-size: 21px; }
    .detail-actions { gap: 10px; }
    .detail-action { flex: 1 1 100%; }
    .mpp-header { padding: 16px 16px 12px; }
    .mpp-body { padding: 0 16px 18px; }

    #mobile-footer-menu a { padding: 2px 8px; }
    #mobile-footer-menu a b { font-size: 9px; }
    #mobile-footer-menu .mf-icon { font-size: 18px; }
    #mobile-footer-menu .mf-publish-btn { width: 36px; height: 36px; }
    #mobile-footer-menu .mf-publish-btn span { font-size: 18px; }

    .mo-cat-grid { padding: 14px 10px 18px; gap: 8px; }
    .mo-cat-item { padding: 4px 0 0; gap: 5px; }
    .mo-cat-icon { width: 48px; height: 48px; }
    .mo-cat-icon img { width: 48px; height: 48px; border-radius: 8px; }
    .mo-cat-label { font-size: 11px; }

    .profile-stats-bar {
        margin: -20px 10px 0;
        padding: 12px 6px;
        border-radius: 12px;
    }
    .stats-num { font-size: 16px; }
    .stats-label { font-size: 9px; }
    .profile-shortcuts { margin: 10px 10px 0; gap: 6px; }
    .shortcut-item { padding: 10px 4px; font-size: 11px; gap: 6px; }
    .shortcut-icon { width: 38px; height: 38px; border-radius: 12px; }
    .shortcut-icon svg { width: 17px; height: 17px; }
    .profile-tab-bar { margin: 10px 10px 0; }

    /* 表单说明文字 */
    .form-desc {
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.5;
        margin-bottom: 14px;
        padding: 0 2px;
    }
}

/* ===== 平板优化 ===== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .photo-wall-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== 照片墙移动端样式 ===== */
@media screen and (max-width: 900px) {
    .profile-photo-wall {
        margin: 14px 14px 0;
        border-radius: 14px;
    }
    .photo-wall-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 12px;
    }
    .photo-wall-grid-portrait .photo-wall-item {
        aspect-ratio: 3 / 4;
    }
    .photo-wall-item {
        border-radius: 8px;
    }
    .photo-wall-title {
        font-size: 14px;
        padding: 14px 16px;
    }
    .photo-wall-placeholder {
        aspect-ratio: 3 / 4;
        border-radius: 8px;
    }
    .photo-wall-empty {
        padding: 30px 16px;
    }
    .photo-wall-empty p {
        font-size: 12px;
    }
    .photo-wall-add-btn {
        padding: 7px 18px;
        font-size: 12px;
    }
    .photo-wall-manage {
        font-size: 11px;
        padding: 2px 8px;
    }

    /* ===== 文章页移动端优化 ===== */
    .post-single {
        padding: 20px 18px;
    }

    .post-single .entry-title {
        font-size: 21px;
        margin: 0 0 12px;
    }

    .post-single .entry-meta {
        font-size: 13px;
        padding-bottom: 14px;
        margin-bottom: 16px;
    }

    .post-single .meta-author-avatar img {
        width: 26px;
        height: 26px;
    }

    .post-single .entry-content {
        font-size: 15px;
        line-height: 1.8;
    }

    .post-single .entry-content h2 { font-size: 19px; }
    .post-single .entry-content h3 { font-size: 17px; }

    .post-single .entry-content blockquote {
        padding: 12px 16px;
        margin: 1em 0;
    }

    .post-single .entry-tags {
        padding-top: 18px;
        margin-top: 18px;
    }

    .post-navigation .nav-previous,
    .post-navigation .nav-next {
        padding: 16px 18px;
    }

    .post-navigation .nav-title {
        font-size: 13px;
    }
}

/* ===== 桌面隐藏移动元素 ===== */
@media screen and (min-width: 901px) {
    #mobile-footer-menu { display: none !important; }
    .mo-cat-grid { display: none !important; }
    .mobile-search-toggle { display: none !important; }
    .mobile-search-bar { display: none !important; }
    .mobile-edit-btn { display: none !important; }
}

/* ===== 分类文章列表（移动端） ===== */
.post-simple-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-item {
    padding: 16px 18px;
}

.post-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary, #222);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary, #3DBCB1);
}

.post-meta {
    font-size: 12px;
    color: var(--text-muted, #999);
    margin-bottom: 8px;
    display: flex;
    gap: 14px;
}

.post-excerpt {
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.7;
}

.post-excerpt p {
    margin: 0;
}

@media screen and (max-width: 480px) {
    .post-item {
        padding: 14px 16px;
    }
    .post-title {
        font-size: 15px;
    }
}
