/* ============================================================
   同城生活网 - 前台样式
   参考风格：绿色搜索栏 / 卡片式列表 / 置顶红标 / 移动端底部导航
   ============================================================ */
:root {
    --primary: #07c160;
    --primary-dark: #06ad56;
    --primary-light: #e8f9ef;
    --red: #ff4d4f;
    --orange: #ff9500;
    --text: #333;
    --muted: #999;
    --bg: #f5f6f7;
    --card: #fff;
    --border: #eee;
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    padding-bottom: 62px; /* 给移动端底部导航留空间 */
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 960px; margin: 0 auto; padding: 0 12px; }

/* ========== 顶部 ========== */
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; }
.brand-text { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.kefu { display: flex; align-items: center; gap: 4px; color: var(--primary); font-size: 13px; }
.kefu-ico { font-size: 16px; }

/* ========== 搜索栏 ========== */
.searchbar { background: var(--primary); padding: 10px 0; }
.searchbar-inner { display: flex; }
.search-form { flex: 1; display: flex; background: #fff; border-radius: 22px; overflow: hidden; height: 40px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.search-city {
    display: flex; align-items: center; padding: 0 12px; color: var(--primary); font-weight: 600;
    border-right: 1px solid #eee; font-size: 13px; white-space: nowrap;
}
.search-form input { flex: 1; border: 0; outline: 0; padding: 0 12px; font-size: 14px; min-width: 0; }
.search-form button {
    width: 70px; border: 0; background: var(--primary-dark); color: #fff; font-size: 15px; cursor: pointer;
}
.search-form button:active { opacity: .85; }

/* ========== 滚动公告 ========== */
.marquee { display: flex; align-items: center; background: #fff8e6; border-bottom: 1px solid #ffe9b8; font-size: 13px; height: 34px; overflow: hidden; }
.marquee-tag {
    flex: none; background: var(--orange); color: #fff; font-size: 12px; padding: 1px 8px;
    border-radius: 3px; margin: 0 8px 0 12px;
}
.marquee-box { flex: 1; overflow: hidden; position: relative; height: 34px; }
.marquee-text { white-space: nowrap; display: inline-block; line-height: 34px; animation: marquee 25s linear infinite; }
@keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@media (max-width: 640px) { .marquee-text { animation-duration: 16s; } }

/* ========== 主导航 ========== */
.mainnav { background: #fff; border-bottom: 1px solid var(--border); }
.mainnav-inner { display: flex; }
.mainnav a { padding: 10px 18px; font-size: 15px; color: #666; position: relative; }
.mainnav a.on { color: var(--primary); font-weight: 600; }
.mainnav a.on::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--primary); border-radius: 2px 2px 0 0; }

/* ========== Banner ========== */
.banner { background: linear-gradient(135deg, #07c160 0%, #05a850 60%, #ffb347 130%); color: #fff; border-radius: var(--radius); margin-top: 12px; padding: 26px 22px; text-align: center; }
.banner-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.banner-sub { margin-top: 6px; font-size: 13px; opacity: .92; }
.banner-img-wrap { margin-top: 12px; }
.banner-img { width: 100%; border-radius: var(--radius); }

/* ========== 统计条 ========== */
.stat-strip { display: flex; justify-content: space-around; background: #fff; border-radius: var(--radius); margin-top: 12px; padding: 12px 6px; font-size: 13px; color: #666; }
.stat-strip b { color: var(--primary); font-size: 16px; }

/* ========== 热门词 ========== */
.hotwords { margin-top: 12px; font-size: 13px; color: #666; }
.hotwords a { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; margin: 3px 4px 3px 0; color: #555; }
.hotwords a:active { border-color: var(--primary); color: var(--primary); }

/* ========== 区块标题 ========== */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.section-title h3 { font-size: 17px; font-weight: 700; position: relative; padding-left: 10px; }
.section-title h3::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: var(--primary); border-radius: 2px; }
.section-title a { font-size: 13px; color: var(--muted); }

/* ========== 分类宫格 ========== */
.cat-grid-wrap { background: #fff; border-radius: var(--radius); margin-top: 12px; padding: 0 6px 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cat-item { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; border-radius: 8px; }
.cat-item:active { background: var(--primary-light); }
.cat-ico { font-size: 26px; height: 34px; display: flex; align-items: center; }
.cat-name { font-size: 12px; color: #555; margin-top: 4px; }

/* ========== 信息卡片 ========== */
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-card {
    display: flex; gap: 12px; background: var(--card); border-radius: var(--radius);
    padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.post-thumb { width: 104px; height: 96px; flex: none; border-radius: 8px; overflow: hidden; position: relative; background: #f0f0f0; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .no-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #bbb; font-size: 12px; }
.badge-top {
    position: absolute; left: 0; top: 0; background: var(--red); color: #fff; font-size: 11px;
    padding: 1px 7px; border-radius: 6px 0 8px 0; z-index: 2;
}
.post-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title { font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag-cat { background: var(--primary-light); color: var(--primary-dark); font-size: 11px; padding: 1px 8px; border-radius: 4px; }
.tag-member { background: #fff4e5; color: var(--orange); font-size: 11px; padding: 1px 8px; border-radius: 4px; }
.post-meta { margin-top: auto; padding-top: 6px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.post-price { color: var(--red); font-size: 16px; font-weight: 700; }
.post-loc { color: #666; }
.post-views { margin-left: auto; }

/* ========== 小区卡片 ========== */
.com-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.com-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.com-cover { height: 80px; background: linear-gradient(135deg, #d7f5e4, #f0f9f4); }
.com-cover img { width: 100%; height: 100%; object-fit: cover; }
.com-name { padding: 8px 10px 2px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.com-meta { padding: 0 10px 10px; font-size: 12px; color: var(--muted); }

/* ========== 筛选栏 ========== */
.filter-bar { display: flex; gap: 8px; background: #fff; border-radius: var(--radius); padding: 10px; margin-top: 12px; flex-wrap: wrap; }
.filter-bar input { flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; outline: none; }
.filter-bar select { border: 1px solid var(--border); border-radius: 6px; padding: 8px 6px; font-size: 13px; background: #fff; }
.filter-bar button { border: 0; background: var(--primary); color: #fff; border-radius: 6px; padding: 8px 18px; cursor: pointer; font-size: 13px; }

.cat-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; white-space: nowrap; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px; font-size: 13px; color: #555; flex: none; }
.cat-nav a.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.result-bar { font-size: 13px; color: #666; margin: 4px 0 10px; }
.result-bar b { color: var(--red); }

/* ========== 分页 ========== */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 18px 0; flex-wrap: wrap; }
.pager a, .pager span.cur { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 13px; color: #555; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .dots { border: 0; }

/* ========== 详情页 ========== */
.detail-card { background: #fff; border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.45; }
.detail-tags { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.gallery { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.gallery-item { width: 140px; height: 110px; object-fit: cover; border-radius: 8px; flex: none; }
.detail-price { font-size: 24px; font-weight: 700; color: var(--red); margin: 6px 0 10px; }
.detail-contact {
    display: flex; align-items: center; gap: 10px; background: var(--primary-light);
    border: 1px dashed var(--primary); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
}
.dc-label { font-size: 12px; color: #888; flex: none; }
.dc-value { font-weight: 600; word-break: break-all; flex: 1; }
.dc-call { background: var(--primary); color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 13px; flex: none; }
.detail-content { font-size: 14px; line-height: 1.8; color: #444; white-space: normal; word-break: break-word; }
.detail-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; flex-wrap: wrap; }

/* ========== 留言 ========== */
.comment-form { background: #fff; border-radius: var(--radius); padding: 12px; }
.comment-form textarea, .comment-form input[type=text] { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; font-size: 14px; outline: none; font-family: inherit; }
.comment-form textarea:focus { border-color: var(--primary); }
.comment-tip { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.comment-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.comment-item { background: #fff; border-radius: var(--radius); padding: 10px 12px; }
.c-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.c-name { font-weight: 600; color: var(--primary-dark); }
.c-content { font-size: 14px; color: #444; word-break: break-word; }

/* ========== 表单/认证 ========== */
.form-card { background: #fff; border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.form-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.form-label i { color: var(--red); font-style: normal; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row select, .form-row textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; background: #fff; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--primary); }
.form-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.auth-wrap { max-width: 420px; }
.auth-card { margin-top: 24px; }
.auth-link { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-link a { color: var(--primary); }

.btn-primary { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 22px; font-size: 14px; cursor: pointer; }
.btn-primary:active { opacity: .88; }
.btn-ghost { background: #fff; color: #555; border: 1px solid var(--border); border-radius: 8px; padding: 8px 18px; font-size: 13px; display: inline-block; text-align: center; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #ffd6d6; border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer; display: inline-block; }
.btn-lg { padding: 11px 28px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* 上传 */
.upload-box { border: 2px dashed #ddd; border-radius: 8px; padding: 22px; text-align: center; cursor: pointer; position: relative; }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-hint { color: var(--muted); font-size: 14px; }
.upload-hint small { color: #bbb; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.upload-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.img-manage { display: flex; flex-wrap: wrap; gap: 8px; }
.img-manage-item { position: relative; width: 90px; height: 90px; border-radius: 6px; overflow: hidden; }
.img-manage-item img { width: 100%; height: 100%; object-fit: cover; }
.img-manage-item input { position: absolute; left: 4px; top: 4px; z-index: 2; }
.img-rm { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }

/* ========== 用户中心 ========== */
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.page-head h2 { font-size: 18px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ucard { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--primary), #05a850); color: #fff; border-radius: var(--radius); padding: 18px; margin-top: 12px; }
.ucard-avatar { width: 60px; height: 60px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; }
.ucard-name { font-size: 18px; font-weight: 700; }
.ucard-sub { font-size: 13px; opacity: .9; margin-top: 2px; }
.ucard-stats { display: flex; background: #fff; border-radius: var(--radius); margin-top: 10px; padding: 14px 0; }
.us-item { flex: 1; text-align: center; }
.us-item b { display: block; font-size: 18px; color: var(--primary); }
.us-item span { font-size: 12px; color: var(--muted); }
.ucard-menu { background: #fff; border-radius: var(--radius); margin-top: 10px; overflow: hidden; }
.ucard-menu a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.ucard-menu a:last-child { border-bottom: 0; }
.ucard-menu i { color: #ccc; font-style: normal; }

/* 我的信息 */
.my-list { display: flex; flex-direction: column; gap: 10px; }
.my-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: var(--radius); padding: 12px; }
.my-thumb { width: 76px; height: 68px; flex: none; border-radius: 6px; overflow: hidden; background: #f0f0f0; }
.my-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-thumb .no-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #bbb; font-size: 11px; }
.my-info { flex: 1; min-width: 0; }
.my-title { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tag-off { background: #eee; color: #999; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.my-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.my-actions { display: flex; flex-direction: column; gap: 6px; }
.my-actions .btn-sm { text-align: center; }

/* ========== 小区页 ========== */
.com-hero { display: flex; gap: 14px; background: #fff; border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.com-hero-cover { width: 120px; height: 90px; flex: none; border-radius: 8px; overflow: hidden; background: #f0f0f0; }
.com-hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.com-hero-info { flex: 1; min-width: 0; }
.com-hero-info h2 { font-size: 18px; }
.com-hero-addr { color: var(--muted); font-size: 13px; margin-top: 2px; }
.com-hero-intro { font-size: 13px; color: #666; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ========== 提示 ========== */
.flash { border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
.flash-success { background: #e8f9ef; color: #0a7a3d; border: 1px solid #b9e8cd; }
.flash-error { background: #fff1f0; color: #c0392b; border: 1px solid #ffd4d4; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: #fff; border-radius: var(--radius); font-size: 14px; }
.empty a { color: var(--primary); }

/* ========== 弹窗公告 ========== */
.popup-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.popup-box {
    position: relative; width: 100%; max-width: 340px; background: #fff; border-radius: 16px;
    padding: 30px 22px 22px; text-align: center; animation: popIn .25s ease;
}
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup-close { position: absolute; right: 12px; top: 10px; font-size: 18px; color: #bbb; cursor: pointer; padding: 4px; }
.popup-icon { font-size: 44px; }
.popup-title { font-size: 17px; font-weight: 700; margin: 10px 0 8px; }
.popup-content { font-size: 13px; color: #666; line-height: 1.8; text-align: left; background: #f7f8fa; border-radius: 8px; padding: 12px; margin-bottom: 16px; max-height: 240px; overflow-y: auto; }
.popup-btn { width: 100%; background: var(--primary); color: #fff; border: 0; border-radius: 24px; padding: 11px; font-size: 15px; cursor: pointer; }

/* ========== 底部 ========== */
.footer { background: #fff; margin-top: 20px; padding: 18px 0 26px; border-top: 1px solid var(--border); text-align: center; }
.footer-txt { font-size: 13px; color: #666; }
.footer-icp { font-size: 12px; color: var(--muted); margin-top: 4px; }
.footer-icp a { color: var(--muted); }
.footer-icp a:hover { color: var(--primary); }
.footer-icp .icp-sep { margin: 0 6px; color: #ccc; }
.footer-icp .police-badge { font-size: 12px; margin-right: 2px; }
.footer-tip { font-size: 12px; color: #bbb; margin-top: 6px; }

/* ========== 移动端底部导航 ========== */
.m-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: #fff;
    display: none; border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0,0,0,.05);
}
.m-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; font-size: 11px; color: #666; }
.m-nav .m-ico { font-size: 20px; line-height: 1.2; }
.m-nav a.m-fab { color: var(--primary); font-weight: 700; }
.m-nav a.m-fab .m-ico { font-size: 22px; }

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .m-nav { display: none; }
    .com-grid { grid-template-columns: repeat(4, 1fr); }
    .com-cover { height: 110px; }
    .post-card { flex-direction: column; padding: 0; overflow: hidden; }
    .post-thumb { width: 100%; height: 160px; }
    .post-info { padding: 10px 12px 12px; }
    .post-meta { gap: 4px 12px; }
    .post-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .cat-grid { grid-template-columns: repeat(8, 1fr); }
    .gallery-item { width: 190px; height: 150px; }
}
@media (max-width: 767px) {
    .m-nav { display: flex; }
    .com-grid { grid-template-columns: repeat(3, 1fr); }
    .banner-title { font-size: 18px; }
}
@media (max-width: 420px) {
    .com-grid { grid-template-columns: repeat(2, 1fr); }
    .search-city { display: none; }
}
