/* 响应式设计 - 移动端优化 */

/* 基础响应式设置 */
@media (max-width: 768px) {
    /* 通用样式 */
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 容器优化 */
    .container, .search-container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* 导航栏优化 */
    .top-navbar {
        height: 56px;
        padding: 0 15px;
    }
    
    .nav-left {
        gap: 8px;
    }
    
    .nav-logo {
        width: 32px;
        height: 32px;
    }
    
    .nav-site-title {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
    
    .nav-site-desc {
        font-size: 0.9rem;
        margin-left: 4px;
    }
    
    .nav-menu {
        gap: 8px;
    }
    
    .nav-item {
        font-size: 0.9rem;
        padding: 6px 12px;
        border-radius: 16px;
    }
    
    .nav-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* 用户下拉菜单优化 */
    .user-dropdown {
        width: 200px;
        right: -10px;
        top: 45px;
    }
    
    .dropdown-item {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* 欢迎区域优化 */
    .hk h1 {
        font-size: 32px !important;
        margin: 20px 0;
    }
    
    .typing-container {
        margin: 30px 0;
    }
    
    .typing-text {
        font-size: 18px;
        padding: 0 8px;
    }
    
    /* 侧边栏优化 */
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .profile-card {
        padding: 20px 15px 15px 15px;
        margin-bottom: 20px;
    }
    
    .profile-img {
        width: 60px;
        height: 60px;
    }
    
    .profile-card h2 {
        font-size: 18px;
        margin: 6px 0 10px 0;
    }
    
    .profile-stats {
        font-size: 12px;
        padding: 6px 0;
        margin: 10px 0 15px 0;
    }
    
    /* 搜索卡片优化 */
    .search-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .search-card h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .search-card input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .search-card button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* 友站和推荐卡片优化 */
    .friend-card, .recommend-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .friend-card h3, .recommend-card h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .friend-card a {
        font-size: 14px;
        margin-right: 6px;
    }
    
    /* 文章列表优化 */
    .post-list {
        gap: 15px;
        margin: 20px auto 0 auto;
    }
    
    .post-card {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .post-cover img {
        height: 140px;
    }
    
    .post-body {
        padding: 15px;
        gap: 6px;
    }
    
    .post-title {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .post-info {
        gap: 12px;
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .post-tag {
        font-size: 12px;
        padding: 1px 8px;
    }
    
    /* 公告卡片优化 */
    .notice-card {
        max-width: 100%;
        font-size: 14px;
        padding: 12px 15px;
        margin: 15px 0 20px 0;
    }
    
    .notice-icon {
        font-size: 18px;
        margin-right: 10px;
    }
    
    /* 分页优化 */
    .pagination {
        text-align: center;
        margin: 20px 0;
        font-size: 14px;
    }
    
    .pagination a {
        display: inline-block;
        padding: 8px 12px;
        margin: 0 4px;
        background: #fff;
        border-radius: 8px;
        text-decoration: none;
        color: #333;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* 手机端首页顶部大图+波浪 */
    .mobile-hero {
        position: relative;
        width: 100vw;
        height: 38vw;
        min-height: 180px;
        max-height: 240px;
        overflow: hidden;
        display: block;
    }
    .mobile-hero-img {
        width: 100vw;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .mobile-hero-title {
        position: absolute;
        left: 0; right: 0; top: 38%;
        text-align: center;
        color: #fff;
        font-size: 2.2rem;
        font-weight: 700;
        letter-spacing: 4px;
        text-shadow: 0 2px 8px #222;
        z-index: 2;
    }
    .mobile-hero-wave {
        position: absolute;
        left: 0; bottom: -1px; width: 100vw; height: 48px;
        z-index: 2;
        pointer-events: none;
    }
    /* 顶部弹窗公告 */
    .mobile-announcement {
        position: fixed;
        top: 18px; left: 50%; transform: translateX(-50%);
        z-index: 1002;
        background: #fff;
        border-radius: 18px;
        box-shadow: 0 2px 16px rgba(0,0,0,0.13);
        padding: 14px 24px 14px 18px;
        min-width: 70vw;
        max-width: 95vw;
        display: flex;
        align-items: center;
        font-size: 1rem;
        color: #333;
        gap: 10px;
        border: 1.5px solid #e0e0e0;
        animation: fadeInDown 0.5s;
    }
    .mobile-announcement .close-btn {
        margin-left: auto;
        font-size: 1.3rem;
        color: #888;
        background: none;
        border: none;
        cursor: pointer;
        outline: none;
    }
    @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-30px); }
        to { opacity: 1; transform: translateY(0); }
    }
    /* 卡片内容区 */
    .mobile-card {
        background: #fff;
        border-radius: 22px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.10);
        margin: 18px 0;
        padding: 18px 16px;
        width: 94vw;
        max-width: 99vw;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    /* 底部Tab栏 */
    .mobile-tabbar {
        position: fixed;
        left: 0; bottom: 0; width: 100vw;
        height: 62px;
        background: rgba(255,255,255,0.95);
        box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
        border-radius: 18px 18px 0 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1003;
        backdrop-filter: blur(8px);
    }
    .mobile-tabbar-item {
        flex: 1;
        text-align: center;
        color: #888;
        font-size: 13px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 2px;
        transition: color 0.2s;
    }
    .mobile-tabbar-item.active,
    .mobile-tabbar-item:active {
        color: #ff5858;
    }
    .mobile-tabbar-icon {
        font-size: 22px;
        margin-bottom: 2px;
        display: block;
    }
    /* 内容底部留白，防止被Tab遮挡 */
    .mobile-bottom-padding { height: 70px; }
    /* 隐藏PC端原有sidebar、顶部导航、公告等 */
    .top-navbar, .sidebar, .notice-card, .site-wrapper { display: none !important; }
    /* 让内容区宽度100% */
    .main-content { margin: 0 !important; width: 100vw !important; }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    /* 导航栏进一步优化 */
    .top-navbar {
        height: 50px;
        padding: 0 10px;
    }
    
    .nav-site-desc {
        display: none;
    }
    
    .nav-menu {
        gap: 4px;
    }
    
    .nav-item {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .nav-item span {
        display: none;
    }
    
    /* 欢迎区域进一步优化 */
    .hk h1 {
        font-size: 24px !important;
        margin: 15px 0;
    }
    
    .typing-text {
        font-size: 16px;
    }
    
    /* 侧边栏进一步优化 */
    .profile-card {
        padding: 15px 10px 10px 10px;
    }
    
    .profile-img {
        width: 50px;
        height: 50px;
    }
    
    .profile-card h2 {
        font-size: 16px;
    }
    
    .profile-stats {
        font-size: 11px;
    }
    
    /* 搜索卡片进一步优化 */
    .search-card {
        padding: 12px;
    }
    
    .search-card h3 {
        font-size: 16px;
    }
    
    .search-card input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    /* 文章卡片进一步优化 */
    .post-cover img {
        height: 120px;
    }
    
    .post-body {
        padding: 12px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-info {
        font-size: 12px;
        gap: 8px;
    }
    
    /* 公告卡片进一步优化 */
    .notice-card {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .notice-icon {
        font-size: 16px;
        margin-right: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .nav-item {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .hk h1 {
        font-size: 20px !important;
    }
    
    .typing-text {
        font-size: 14px;
    }
    
    .profile-img {
        width: 45px;
        height: 45px;
    }
    
    .post-cover img {
        height: 100px;
    }
    
    .post-title {
        font-size: 15px;
    }
}

/* 文章详情页优化 */
@media (max-width: 768px) {
    .detail-header-bg {
        max-height: 200px;
        min-height: 120px;
    }
    
    .detail-header-bg img {
        height: 200px;
    }
    
    .detail-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .detail-meta {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .detail-tag {
        font-size: 0.8rem;
        padding: 1px 8px;
        margin-right: 6px;
    }
    
    .detail-content {
        margin: 20px auto 0 auto;
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .detail-images {
        gap: 10px;
        margin: 15px 0 0 0;
    }
    
    .detail-images img {
        width: calc(50% - 5px);
        height: 80px;
        border-radius: 8px;
    }
}

/* 搜索页面优化 */
@media (max-width: 768px) {
    .search-container {
        padding: 20px 0 0 0;
    }
    
    .search-title {
        font-size: 1.2rem;
        margin-bottom: 20px;
        padding: 0 15px;
    }
    
    .search-card {
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .search-card-info {
        padding: 15px;
    }
    
    .search-card-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .search-card-meta {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .search-card-hot, .search-card-comment {
        font-size: 0.9rem;
    }
    
    .search-card-summary {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .search-card-tag {
        font-size: 0.85rem;
        padding: 1px 8px;
        margin-right: 6px;
    }
    
    .search-card-img {
        height: 140px;
    }
    
    .search-card-img img {
        height: 140px;
        border-radius: 0 0 16px 16px;
    }
}

/* 弹幕墙页面优化 */
@media (max-width: 768px) {
    .barrage-container {
        padding: 10px;
    }
    
    .barrage-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .barrage-input input {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .barrage-input button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .barrage-message {
        font-size: 14px;
        padding: 8px 12px;
        margin: 5px;
    }
}

/* 朋友页面优化 */
@media (max-width: 768px) {
    .friends-header {
        padding: 20px 15px;
        text-align: center;
    }
    
    .friends-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .friends-poem {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .friends-author {
        font-size: 0.9rem;
    }
    
    .friend-post {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .friend-post-content {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .friend-post-meta {
        font-size: 12px;
    }
    
    .friend-post-form {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .friend-post-form textarea {
        font-size: 14px;
        padding: 10px;
    }
    
    .friend-post-form button {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* 通用移动端优化 */
@media (max-width: 768px) {
    /* 防止水平滚动 */
    body {
        overflow-x: hidden;
    }
    
    /* 触摸优化 */
    button, a, input, textarea {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* 图片优化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 表单优化 */
    input, textarea, select {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 链接优化 */
    a {
        text-decoration: none;
    }
    
    /* 卡片阴影优化 */
    .card, .post-card, .search-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}
