/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-menu {
        position: static;
        display: flex;
        flex-wrap: wrap;
    }
}

/* ===== 手机端 ===== */
@media (max-width: 900px) {
    :root {
        --nav-height: 56px;
    }

    body {
        overflow-x: hidden;
    }

    .nav-container {
        height: var(--nav-height);
        padding: 0 14px;
        gap: 8px;
    }

    /* 缩小 logo，给右侧按钮留出空间 */
    .nav-brand {
        font-size: 1.14rem;
        letter-spacing: 0.2px;
    }

    .nav-left {
        gap: 2px;
        min-width: 0;
    }

    .theme-btn {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .theme-btn .icon {
        width: 18px;
        height: 18px;
    }

    .hamburger {
        display: flex;
        width: 36px;
        height: 36px;
        padding: 7px;
        flex-shrink: 0;
    }

    .hamburger span {
        width: 20px;
    }

    /* 桌面端右侧的发布 / 个人中心 / 退出全部收进汉堡菜单 */
    .nav-user {
        display: none;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 10px 14px 18px;
        gap: 2px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        transform: translateY(-110%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* 封禁提示条位于导航下方时，菜单需继续下移，避免遮挡 */
    body.has-account-banner .nav-menu {
        top: 116px;
        max-height: calc(100vh - 116px);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 11px 14px;
        font-size: 0.95rem;
        border-radius: 9px;
    }

    .nav-menu li.mobile-only {
        display: block;
    }

    .nav-menu li.desktop-only {
        display: none;
    }

    .nav-menu li.mobile-account {
        display: flex;
        width: 100%;
        padding: 10px 14px 2px;
        margin-top: 6px;
    }

    .mobile-account .mobile-user-link {
        padding: 4px 0 !important;
    }

    .mobile-account .btn {
        padding: 5px 12px;
        font-size: 0.78rem;
    }

    /* 页面间距 */
    .page {
        padding: 78px 16px 32px;
    }

    body.has-account-banner .page {
        padding-top: 142px;
    }

    .hero {
        padding: 96px 16px 26px;
    }

    body.has-account-banner .hero {
        padding-top: 160px;
    }

    .hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .search-wrapper {
        margin-top: 22px;
    }

    .search-box {
        padding-left: 12px;
    }

    .search-box input {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .search-btn {
        padding: 8px 16px;
        flex-shrink: 0;
    }

    .announcement {
        padding: 0 16px;
        margin-top: 12px;
    }

    .announcement-inner {
        padding: 9px 12px;
        gap: 8px;
    }

    .announcement-text {
        font-size: 0.82rem;
    }

    .announcement-text span {
        animation-duration: 22s;
    }

    /* 内容卡片 */
    .layout {
        gap: 18px;
        margin-top: 18px;
    }

    .article-card {
        padding: 18px;
    }

    .article-card h3 {
        font-size: 1.08rem;
    }

    .article-meta {
        gap: 8px 10px;
    }

    .article-detail {
        padding: 22px 18px;
    }

    .article-detail .article-title {
        font-size: 1.35rem;
    }

    .comment-item.reply {
        margin-left: 12px;
    }

    .comment-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 22px 18px;
    }

    .profile-actions {
        justify-content: center;
        width: 100%;
    }

    .profile-action-grid {
        width: 100%;
        max-width: 360px;
    }

    .profile-meta {
        justify-content: center;
        gap: 10px 14px;
    }

    .user-section-head {
        align-items: flex-start;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-panel {
        padding: 16px;
    }

    .admin-subsection {
        padding: 16px 0;
    }

    .admin-check-row {
        flex-direction: column;
        gap: 8px;
    }

    /* 表单：避免 iOS 聚焦时自动放大 */
    .form-input {
        font-size: 16px;
    }

    .btn {
        padding: 9px 18px;
    }

    .btn-sm {
        padding: 6px 12px;
    }

    /* 消息中心 / 举报 / 关注列表 */
    .notification-item {
        padding: 14px 16px;
    }

    .notification-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .notification-actions form {
        flex: 1 1 auto;
    }

    .notification-actions .btn {
        width: 100%;
    }

    .report-card {
        padding: 20px 16px;
    }

    .report-card h2 {
        font-size: 1.12rem;
    }

    .report-snapshot {
        max-height: 180px;
    }

    .report-actions .btn {
        flex: 1 1 auto;
    }

    .report-admin-card {
        padding: 16px;
    }

    .report-action-buttons {
        gap: 6px;
    }

    .follow-item {
        gap: 10px;
    }

    .follow-item form,
    .follow-item .btn {
        width: 100%;
    }

    .tabs-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabs {
        min-width: max-content;
    }

    .follow-visibility-hint {
        margin-left: 0;
        width: 100%;
        white-space: normal;
    }

    /* 登录页 */
    .auth-page {
        padding: 88px 16px 40px;
    }

    body.has-account-banner .auth-page {
        padding-top: 142px;
    }

    .auth-card {
        padding: 26px 20px;
    }

    footer {
        padding: 26px 16px;
    }

    /* 窄屏下放回文档流，保持右下角对齐，避免与备案信息重叠 */
    .footer-uptime {
        position: static;
        justify-content: flex-end;
        margin-top: 12px;
    }
}

@media (max-width: 420px) {
    .nav-brand {
        font-size: 1rem;
    }

    .hero h1 {
        font-size: 1.72rem;
    }

    .search-btn {
        padding: 8px 12px;
    }

    .profile-actions .btn,
    .profile-actions form {
        width: 100%;
    }

    .profile-actions form .btn {
        width: 100%;
    }

    .article-manage-head {
        flex-direction: column;
        gap: 8px;
    }

    .article-manage-actions {
        width: 100%;
    }

    .article-manage-actions .btn,
    .article-manage-actions form {
        flex: 1;
    }

    .article-manage-actions form .btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .profile-action-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
}
