/* 全局重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    background-color: #f4f6f9;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- 搜索栏 (Header) - 清新绿色渐变 --- */
.search-bar {
    /* 清新绿色动态渐变背景 */
    background: linear-gradient(-45deg, #6B4C9A, #8E44AD, #D965C8, #FF69B4);
    background-size: 400% 400%;
    animation: gradientBreath 6s ease infinite; /* 呼吸动画 */
    
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 15px;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.25);
    z-index: 100;
    position: relative;
}

@keyframes gradientBreath {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 游戏按钮 */
.city-btn {
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 25px;
    color: #fff;
    /* 清新绿→青色渐变 */
    background: linear-gradient(135deg, #8E44AD, #6B4C9A);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.35);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: gamePulse 3s ease-in-out infinite;
}

@keyframes gamePulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(142, 68, 173, 0.35); }
    50% { box-shadow: 0 4px 18px rgba(107, 76, 154, 0.55), 0 0 8px rgba(142, 68, 173, 0.3); }
}

.city-btn:hover {
    background: linear-gradient(135deg, #D965C8, #8E44AD);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(217, 101, 200, 0.5), 0 0 15px rgba(142, 68, 173, 0.4);
    animation: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.city-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.3);
}

.city-btn i,
.city-btn svg {
    font-size: 16px;
    transition: transform 0.3s;
}

.city-btn:hover i,
.city-btn:hover svg {
    transform: rotate(15deg) scale(1.2);
}

/* 搜索输入框区域 */
.search-input {
    width: 65%;
    max-width: 500px;
}

/* 覆盖 ElementUI 输入框样式 */
.search-input .el-input__inner {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 20px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 13px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-input .el-input__inner:focus {
    background-color: #fff !important;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.4); /* 聚焦时绿色光晕 */
    transform: scale(1.02);
}

.search-input .el-input__icon {
    line-height: 32px !important;
    color: #6B4C9A;
}

/* 右侧用户图标 */
.header-icon {
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #fff;
}

.header-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

/* --- 分类列表 (Type List) --- */
.type-list {
    height: auto;
    min-height: 120px;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 90;
    padding: 10px 0;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.type-box {
    width: 16%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性过渡 */
    padding: 5px 0;
    border-radius: 8px;
}

.type-box:hover {
    transform: translateY(-3px) scale(1.02);
    background-color: #fff0f5;
    box-shadow: 0 6px 12px rgba(142, 68, 173, 0.1);
}

.type-box img {
    width: 40px; /* 固定图标大小 */
    height: 40px;
    object-fit: contain;
    margin-bottom: 3px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.type-text {
    color: #555;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s;
}

.type-box:hover .type-text {
    color: #6B4C9A;
    font-weight: bold;
}

/* --- 博客列表 (Blog List) --- */
.blog-list {
    background-color: #f4f6f9;
    width: 100%;
    
    /* 1. 允许增长，但不强制拉伸内容间距 */
    flex: 1 1 auto; 
    
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    
    /* 2. 关键：内容靠上对齐，防止稀疏内容被拉开 */
    align-content: flex-start; 
    
    /* 3. 关键：底部留出足够空间给固定底部的导航栏 (假设导航栏高 60px) */
    /* 如果导航栏不是固定的，这个 padding 会让底部多出一段空白，那是正常的"留白" */
    padding: 10px 5px 80px 5px;
    
    overflow-y: auto;
    gap: 10px;
    
    /* 隐藏滚动条样式 (保持不变) */
    /* ... */
}

/* 隐藏滚动条但保留功能 */
.blog-list::-webkit-scrollbar {
    width: 6px;
}
.blog-list::-webkit-scrollbar-thumb {
    background-color: #e0d0e0;
    border-radius: 3px;
}

.blog-box {
    width: 48.5%; /* 适应 gap */
    background-color: #fff;
    border-radius: 8px;
    flex-shrink: 0; 
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px; /* 移除 margin，用 gap 控制 */
    margin: 0; 
}

.blog-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(142, 68, 173, 0.15);
    border: 1px solid #e0c0d8; /* 悬停时出现浅绿边框 */
}

.blog-img {
    width: 100%;
    height: 160px; /* 固定高度防止跳动 */
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-box:hover .blog-img img {
    transform: scale(1.1); /* 图片悬停放大 */
}

.blog-title {
    padding: 10px;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: bold;
}

.blog-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-top: auto; /* 推到底部 */
    background-color: #f8f6f9;
    border-top: 1px solid #f0e8f0;
}

.blog-user-info {
    display: flex;
    align-items: center;
    width: 70%;
    overflow: hidden;
}

.blog-user-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 6px;
    flex-shrink: 0;
}

.blog-user-icon img {
    width: 100%;
    height: 100%;
}

.blog-user-name {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 点赞区域 */
.blog-liked {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 15px;
}

.blog-liked:hover {
    background-color: #fce4ec;
    color: #FF69B4;
}

.blog-liked svg {
    margin-right: 4px;
    transition: transform 0.2s;
}

/* 点击点赞时的动画类 (可通过JS添加，这里做悬停效果) */
.blog-liked:active svg {
    transform: scale(0.8);
}

/* 已点赞状态颜色由 Vue 控制 fill，这里统一文字颜色 */
.blog-liked.active {
    color: #FF69B4;
    font-weight: bold;
}




/* --- 【新增】底部发布按钮美化 - 清新绿渐变 + 悬停放大 + 点击反馈 --- */

/* 1. 移除 publish-box 的默认底座（如果有的话）*/
.publish-box {
    background: transparent !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    width: 20% !important;
    height: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 2. 重新设计 add-btn 为清新绿渐变圆形按钮 */
.publish-box .add-btn {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    
    /* 关键：使用与 Header 相同的清新绿色渐变 */
    background: linear-gradient(135deg, #8E44AD, #D965C8) !important;
    
    /* 如果原图是黑色加号，这里让它变白；如果是透明 PNG，可忽略这行 */
    /* filter: brightness(0) invert(1) !important; */
    
    padding: 10px !important;
    box-sizing: border-box !important;
    
    /* 清新绿色柔和阴影 */
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.4) !important;
    
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer;
    z-index: 2;
    position: relative;
}

/* 3. 悬停效果：按钮自身放大 + 阴影增强 + 渐变反转 */
.publish-box:hover .add-btn {
    transform: scale(1.15) !important;
    box-shadow: 0 6px 16px rgba(142, 68, 173, 0.6) !important;
    background: linear-gradient(135deg, #D965C8, #8E44AD) !important;
}

/* 4. 点击效果：轻微缩小，提供触觉反馈 */
.publish-box:active .add-btn {
    transform: scale(0.95) !important;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.3) !important;
}

/* 5. 隐藏原来的 publish-glow（避免冲突）*/
.publish-box .publish-glow {
    display: none !important;
}

/* 6. 确保其他 foot-box 不受影响 */
.foot-box:not(.publish-box) {
    margin-top: 0 !important;
}

/* 7. 可选：给激活状态的图标也增加一点发光效果（可选优化）*/
.foot-box.active .foot-view i {
     color: #8E44AD !important;  
    text-shadow: 0 0 8px rgba(142, 68, 173, 0.5);
}
