/* 吃瓜公社 - 全局样式 */
:root {
    --primary: #ff6b35;
    --primary-light: #ff8c5a;
    --primary-dark: #e55a2b;
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #eeeeee;
    --gold: #ffd700;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 70px;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.logo span { font-size: 18px; }
.nav { display: flex; gap: 16px; }
.nav a { font-size: 14px; opacity: 0.9; }
.nav a.active { opacity: 1; font-weight: 600; }
.back-btn { color: white; font-size: 16px; }
.header-title { font-size: 16px; font-weight: 600; }
.vip-btn { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; font-size: 13px; }

/* 搜索栏 */
.search-bar { background: white; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.search-bar form { display: flex; gap: 8px; max-width: 600px; margin: 0 auto; }
.search-input {
    flex: 1; padding: 10px 16px; border: 1px solid var(--border);
    border-radius: 25px; font-size: 14px; outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-btn {
    width: 40px; height: 40px; border: none; background: var(--primary);
    color: white; border-radius: 50%; cursor: pointer; font-size: 16px;
}

/* 分类导航 */
.category-nav { background: white; padding: 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.category-nav .container { display: flex; gap: 8px; white-space: nowrap; }
.cat-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 12px; border-radius: 10px; min-width: 60px;
    transition: all 0.2s;
}
.cat-item.active { background: rgba(255,107,53,0.1); }
.cat-icon { font-size: 22px; }
.cat-name { font-size: 12px; color: var(--text-secondary); }
.cat-item.active .cat-name { color: var(--primary); font-weight: 600; }

/* 区块 */
.section { padding: 16px 0; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* 热门列表 */
.hot-list { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hot-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-bottom: 1px solid var(--border); transition: background 0.2s;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:active { background: #f9f9f9; }
.hot-rank {
    width: 24px; height: 24px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
    background: var(--text-muted); color: white; flex-shrink: 0;
}
.rank-1 { background: #ff4757; }
.rank-2 { background: #ff6348; }
.rank-3 { background: #ffa502; }
.hot-info { flex: 1; min-width: 0; }
.hot-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-meta { font-size: 12px; color: var(--text-muted); }

/* 文章列表 */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow); transition: transform 0.2s; display: block;
}
.article-card:active { transform: scale(0.98); }
.article-card.small { padding: 12px; }
.article-cat {
    display: inline-block; padding: 2px 8px; background: rgba(255,107,53,0.1);
    color: var(--primary); border-radius: 4px; font-size: 12px; margin-bottom: 8px;
}
.article-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.article-card.small .article-title { font-size: 14px; }
.article-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.article-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
    padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; color: var(--text-secondary);
}
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* 投稿横幅 */
.submit-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; padding: 24px 0; margin: 16px 0;
}
.banner-content { text-align: center; }
.banner-content h3 { font-size: 20px; margin-bottom: 8px; }
.banner-content p { font-size: 14px; opacity: 0.9; margin-bottom: 16px; }
.btn-white {
    display: inline-block; padding: 10px 28px; background: white; color: #667eea;
    border-radius: 25px; font-weight: 600; font-size: 14px;
}

/* 底部 */
.footer { text-align: center; padding: 24px 0; color: var(--text-muted); font-size: 12px; }
.footer p { margin-bottom: 6px; }
.footer-disclaimer { font-size: 11px; opacity: 0.7; }
.footer-icp a { color: var(--text-muted); }

/* 底部Tab */
.tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0; background: white;
    display: flex; justify-content: space-around; padding: 8px 0;
    border-top: 1px solid var(--border); z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--text-muted); flex: 1;
}
.tab-item .icon { font-size: 20px; }
.tab-item.active { color: var(--primary); }
.tab-center .icon {
    width: 44px; height: 44px; background: var(--primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-top: -16px; box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

/* 文章详情 */
.article-detail { padding: 16px 0; }
.article-header { margin-bottom: 20px; }
.article-title-large { font-size: 22px; font-weight: 700; line-height: 1.4; margin: 12px 0; }
.article-meta-detail { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.article-body { font-size: 16px; line-height: 1.9; color: var(--text); }
.article-body p { margin-bottom: 16px; text-indent: 2em; }
.article-disclaimer {
    margin: 24px 0; padding: 12px 16px; background: #fff8e1;
    border-left: 3px solid #ffc107; border-radius: 4px; font-size: 12px; color: #856404;
}
.article-actions { display: flex; gap: 12px; margin: 20px 0; }
.action-btn {
    flex: 1; padding: 10px; border: 1px solid var(--border); background: white;
    border-radius: 8px; font-size: 14px; cursor: pointer;
}
.related-section { margin-top: 32px; }

/* 付费墙 */
.paywall {
    margin: 24px 0; padding: 30px 20px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius); text-align: center; color: white;
}
.paywall-icon { font-size: 48px; margin-bottom: 12px; }
.paywall h3 { font-size: 20px; margin-bottom: 8px; }
.paywall p { font-size: 14px; opacity: 0.8; margin-bottom: 20px; }
.paywall-btns { display: flex; flex-direction: column; gap: 10px; }

/* 按钮 */
.btn-primary {
    display: inline-block; padding: 12px 32px; background: var(--primary);
    color: white; border: none; border-radius: 25px; font-size: 15px;
    font-weight: 600; cursor: pointer; text-align: center;
}
.btn-secondary {
    display: inline-block; padding: 12px 32px; background: transparent;
    color: var(--text-secondary); border: 1px solid var(--border);
    border-radius: 25px; font-size: 15px; cursor: pointer; text-align: center;
}

/* VIP页面 */
.vip-container { max-width: 600px; margin: 0 auto; padding: 20px 16px 80px; }
.vip-header {
    text-align: center; padding: 30px 20px; margin-bottom: 20px;
    background: linear-gradient(135deg, #1a1a0a 0%, #252515 100%);
    border: 1px solid var(--gold); border-radius: 16px; color: white;
}
.vip-header h1 { font-size: 24px; color: var(--gold); margin-bottom: 8px; }
.vip-header p { font-size: 14px; color: rgba(255,255,255,0.7); }
.vip-status { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.vip-badge { padding: 6px 16px; background: rgba(255,215,0,0.2); border-radius: 20px; color: var(--gold); font-size: 14px; }
.vip-status.active .vip-badge { background: var(--gold); color: #1a1a0a; font-weight: 600; }
.vip-expire { font-size: 13px; color: rgba(255,255,255,0.6); }

.vip-packages { margin-bottom: 24px; }
.package-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.package-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 16px 10px; text-align: center; position: relative; transition: all 0.2s;
}
.package-card.hot { border-color: var(--primary); }
.package-card.gold { border-color: var(--gold); background: linear-gradient(135deg, #fffdf0 0%, #fff8dc 100%); }
.package-tag {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    padding: 2px 10px; background: var(--primary); color: white;
    border-radius: 10px; font-size: 11px;
}
.package-card.gold .package-tag { background: var(--gold); color: #333; }
.package-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.package-price { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.package-card.gold .package-price { color: #d4a017; }
.package-desc { font-size: 11px; color: var(--text-muted); }

/* 抽奖 */
.lottery-section {
    background: var(--bg-card); border-radius: 16px; padding: 20px;
    margin-bottom: 24px; text-align: center;
}
.lottery-tip { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.lottery-count { color: var(--primary); font-weight: 700; font-size: 18px; }
.lottery-box { margin: 20px 0; }
.lottery-wheel {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    max-width: 300px; margin: 0 auto 20px;
}
.lottery-item {
    padding: 16px 8px; background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    border-radius: 10px; font-size: 12px; text-align: center;
}
.btn-lottery {
    padding: 14px 40px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white; border: none; border-radius: 30px; font-size: 16px;
    font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px rgba(255,107,53,0.4);
}
.btn-lottery:disabled { opacity: 0.5; cursor: not-allowed; }
.lottery-result { margin-top: 16px; padding: 12px; border-radius: 8px; }
.result-win { background: #d4edda; color: #155724; font-weight: 600; }
.result-lose { background: #f8d7da; color: #721c24; }
.lottery-hint { font-size: 12px; color: var(--text-muted); margin: 12px 0; }

/* 邀请 */
.invite-section { background: var(--bg-card); border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.invite-stats { display: flex; gap: 20px; justify-content: center; margin-bottom: 20px; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.invite-link-box { background: var(--bg); padding: 16px; border-radius: 10px; margin-bottom: 16px; }
.invite-link-box p { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.invite-link {
    font-size: 12px; color: var(--text-muted); word-break: break-all;
    background: white; padding: 8px; border-radius: 6px; margin-bottom: 10px;
}
.btn-copy {
    width: 100%; padding: 10px; background: var(--primary); color: white;
    border: none; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.invite-rules { font-size: 13px; color: var(--text-secondary); }
.invite-rules p { margin-bottom: 6px; }

/* VIP权益 */
.vip-benefits { background: var(--bg-card); border-radius: 16px; padding: 20px; }
.benefit-list { display: flex; flex-direction: column; gap: 16px; }
.benefit-item { display: flex; gap: 12px; align-items: flex-start; }
.benefit-icon { font-size: 28px; flex-shrink: 0; }
.benefit-item h4 { font-size: 15px; margin-bottom: 4px; }
.benefit-item p { font-size: 13px; color: var(--text-secondary); }

/* 分类网格 */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.category-card {
    background: var(--bg-card); border-radius: 12px; padding: 20px;
    text-align: center; box-shadow: var(--shadow); transition: transform 0.2s;
}
.category-card:active { transform: scale(0.97); }
.cat-icon-large { font-size: 36px; display: block; margin-bottom: 8px; }
.category-card h3 { font-size: 16px; margin-bottom: 6px; }
.category-card p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.cat-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

/* 投稿页 */
.submit-container { padding: 20px 0; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.page-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.submit-form { background: var(--bg-card); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-input {
    width: 100%; padding: 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none;
}
.form-input:focus { border-color: var(--primary); }
.form-textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none; resize: vertical;
    font-family: inherit; line-height: 1.6;
}
.form-tips { background: #f0f7ff; padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.form-tips p { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #1890ff; }
.form-tips ul { padding-left: 20px; font-size: 12px; color: var(--text-secondary); }
.form-tips li { margin-bottom: 4px; }
.btn-submit {
    width: 100%; padding: 14px; background: var(--primary); color: white;
    border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.submit-success {
    background: var(--bg-card); border-radius: 16px; padding: 40px 20px;
    text-align: center; margin-bottom: 20px;
}
.submit-success .success-icon { font-size: 64px; margin-bottom: 16px; }
.submit-success h3 { font-size: 20px; margin-bottom: 8px; }
.submit-success p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.submit-rules { background: #fff8e1; padding: 16px; border-radius: 10px; }
.submit-rules h3 { font-size: 15px; margin-bottom: 10px; color: #856404; }
.submit-rules ul { padding-left: 20px; font-size: 13px; color: #856404; }
.submit-rules li { margin-bottom: 6px; }

/* 搜索页 */
.search-page { padding: 16px 0; }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input-large {
    flex: 1; padding: 12px 16px; border: 1px solid var(--border);
    border-radius: 25px; font-size: 15px; outline: none;
}
.search-btn-large {
    width: 44px; height: 44px; border: none; background: var(--primary);
    color: white; border-radius: 50%; cursor: pointer; font-size: 18px;
}
.search-result-count { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.search-hot { background: var(--bg-card); border-radius: 16px; padding: 20px; }
.search-hot h3 { font-size: 16px; margin-bottom: 12px; }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    padding: 6px 14px; background: var(--bg); border-radius: 20px;
    font-size: 13px; color: var(--text-secondary);
}

/* 支付成功 */
.success-container { max-width: 500px; margin: 0 auto; padding: 40px 20px; }
.success-card {
    background: var(--bg-card); border-radius: 16px; padding: 40px 24px;
    text-align: center; box-shadow: var(--shadow);
}
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-title { font-size: 24px; color: var(--success); margin-bottom: 12px; }
.success-order { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.success-product { font-size: 16px; margin-bottom: 8px; }
.success-money { font-size: 32px; font-weight: 700; color: var(--primary); margin: 16px 0; }
.success-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.8; }
.success-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.success-tips { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 16px; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; }
.empty p { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; }

/* 响应式 */
@media (min-width: 768px) {
    .container { max-width: 800px; }
    .package-list { grid-template-columns: repeat(6, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 友情链接 */
.friend-links {
    background: white;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}
.links-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.link-item {
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.link-item:hover {
    background: var(--primary);
    color: white;
}

/* 评论区 */
.comment-section {
    margin-top: 32px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}
.comment-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.comment-body {
    flex: 1;
    min-width: 0;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.comment-user {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.comment-time {
    font-size: 12px;
    color: var(--text-muted);
}
.comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}
.comment-actions {
    display: flex;
    gap: 16px;
}
.comment-like, .comment-reply {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}
.comment-like:hover {
    color: var(--primary);
}
.comment-input-box {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}
.comment-input:focus {
    border-color: var(--primary);
}
.comment-submit {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 热门标签区 */
.hot-tags-section {
    background: var(--bg-card);
    padding: 20px 0;
    margin: 16px 0;
}
.hot-tags-section .hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hot-tags-section .tag {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.hot-tags-section .tag:hover {
    background: var(--primary);
    color: white;
}
