/* ========================================
   轻量社区论坛 - 移动端优先样式
   版本：2.0
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
    padding-bottom: 70px;
    font-size: 14px;
}

/* ========================================
   顶部导航栏
   ======================================== */
.header {
    background: #fff;
    padding: 12px 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-btn {
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.menu-btn span {
    width: 20px;
    height: 2px;
    background: #333;
    margin: 2px 0;
    display: block;
}

.site-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffcc00;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-left: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ========================================
   顶部统计栏
   ======================================== */
.stats-bar {
    background: #fff;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.stats-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    color: #666;
    font-size: 13px;
}

.stats-item span {
    color: #333;
    font-weight: 600;
    margin-right: 3px;
}

.stats-site {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: #333;
    font-weight: 500;
}

.stats-site svg {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    fill: #333;
}

/* ========================================
   横幅广告区
   ======================================== */
.banner-ads {
    padding: 10px 0;
}

.banner-item {
    background: #fff;
    margin: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: relative;
}

.banner-close {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.banner-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 20px;
    font-size: 24px;
}

.banner-content {
    flex: 1;
    margin-left: 12px;
}

.banner-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.banner-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

/* ========================================
   顶部紫色功能按钮区
   ======================================== */
.top-buttons {
    background: #fff;
    padding: 12px 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.top-btn {
    background: linear-gradient(135deg, #7c4dff 0%, #651fff 100%);
    color: #fff;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: block;
    border: 2px solid #8a5fff;
    box-shadow: 0 2px 8px rgba(108, 72, 255, 0.3);
    transition: all 0.3s ease;
}

.top-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 72, 255, 0.4);
}

.top-btn:active {
    transform: translateY(0);
}

/* ========================================
   左侧注册福利提示
   ======================================== */
.welfare-sidebar {
    position: fixed;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    padding: 15px 8px;
    border-radius: 8px;
    writing-mode: vertical-rl;
    font-size: 13px;
    font-weight: 500;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
}

/* ========================================
   图标广告区
   ======================================== */
.icon-ads {
    background: #fff;
    padding: 15px;
    margin-top: 10px;
}

.icon-ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 10px;
}

.icon-ad-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.icon-ad-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.icon-ad-name {
    color: #333;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.icon-ad-welfare {
    color: #ff3366;
    font-size: 11px;
    font-weight: 600;
}

.icon-ad-welfare.blue {
    color: #0066ff;
}

/* ========================================
   帖子分类标签
   ======================================== */
.post-tabs {
    background: #fff;
    padding: 12px 15px;
    display: flex;
    gap: 20px;
    margin-top: 10px;
    align-items: center;
}

.post-tab {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 3px solid transparent;
}

.post-tab.active {
    color: #333;
    border-bottom-color: #0066ff;
    font-weight: 600;
}

.post-tabs-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.tab-action-btn {
    background: #fff;
    border: 1px solid #0066ff;
    color: #0066ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

/* ========================================
   帖子列表
   ======================================== */
.posts-list {
    padding: 10px 0;
}

.post-item {
    background: #fff;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.post-header {
    display: flex;
    align-items: flex-start;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.post-info {
    flex: 1;
    margin-left: 12px;
}

.post-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.post-badge {
    background: #ff3366;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 5px;
}

.post-badge.green {
    background: #00cc66;
}

.post-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.post-title .highlight {
    color: #ff3366;
}

.post-meta-row {
    display: flex;
    align-items: center;
    margin-top: 5px;
    flex-wrap: wrap;
}

.guaranteed-tag {
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 8px;
}

.guaranteed-tag svg {
    width: 14px;
    height: 14px;
    margin-right: 3px;
    vertical-align: middle;
}

.post-author {
    color: #999;
    font-size: 12px;
}

.post-reward {
    color: #ff9900;
    font-size: 12px;
    margin-left: 10px;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.post-time {
    color: #999;
    font-size: 12px;
}

.post-comments {
    display: flex;
    align-items: center;
    color: #999;
    font-size: 13px;
}

.post-comments svg {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    stroke: #999;
}

/* ========================================
   中间登录/注册提示
   ======================================== */
.login-banner {
    text-align: center;
    padding: 20px;
}

.login-banner a {
    color: #00ccff;
    text-decoration: none;
    font-weight: 500;
}

.login-banner a span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
}

/* ========================================
   底部导航栏
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    padding: 5px 20px;
}

.bottom-nav-item.active {
    color: #667eea;
}

.bottom-nav-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
}

.bottom-nav-item .label {
    font-size: 11px;
    font-weight: 500;
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }
    
    .icon-ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px 8px;
    }
    
    .icon-ad-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .top-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .top-btn {
        padding: 10px 5px;
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item,
.banner-item,
.icon-ad-item {
    animation: fadeIn 0.3s ease;
}
