/* ============================================
   邻家同城 - 主样式
   设计风格：暖橙主色 + 深蓝辅助，现代卡片式
   ============================================ */
:root {
    --primary: #ff6b35;
    --primary-dark: #e8551f;
    --primary-light: #fff0e9;
    --navy: #1a2b4a;
    --navy-light: #2c4266;
    --text: #24304a;
    --text-muted: #8a94a8;
    --line: #eef1f6;
    --bg: #f5f7fa;
    --white: #fff;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(26, 43, 74, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: 0; background: none; }

/* 顶部应用栏 */
.appbar {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, #ff6b35, #ff8f5e);
    padding: calc(env(safe-area-inset-top) + 12px) 16px 14px;
    color: #fff;
}
.appbar-row { display: flex; align-items: center; gap: 12px; }
.city-picker {
    display: flex; align-items: center; gap: 4px;
    font-size: 15px; font-weight: 700; white-space: nowrap;
}
.city-picker::after { content: ''; width: 0; height: 0; border: 5px solid transparent; border-top-color: #fff; margin-top: 5px; }
.search-box {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.95); border-radius: 22px;
    padding: 9px 14px; color: #9aa4b5;
}
.search-box svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-box span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 页面容器 */
.container { max-width: 640px; margin: 0 auto; padding: 0 14px; }
.section { margin-top: 16px; }
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.section-hd h2 { font-size: 17px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.section-hd h2::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
.section-hd .more { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.section-hd .more::after { content: '›'; font-size: 18px; line-height: 1; }

/* 图标分类网格 */
.cat-grid {
    background: var(--white); border-radius: var(--radius);
    padding: 16px 8px; margin-top: 12px;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 4px;
    box-shadow: var(--shadow);
}
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.cat-icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s;
}
.cat-item:active .cat-icon { transform: scale(.92); }
.cat-icon svg { width: 24px; height: 24px; }
.cat-item span { font-size: 12px; color: var(--text); white-space: nowrap; }

/* 头条 */
.headline {
    margin-top: 12px; background: var(--white); border-radius: var(--radius);
    padding: 12px 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
    overflow: hidden;
}
.headline-tag {
    flex-shrink: 0; background: var(--navy); color: #fff;
    font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; letter-spacing: 1px;
}
.headline-text { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.headline-arrow { color: var(--text-muted); font-size: 18px; }

/* 发布横幅 */
.promo-banner {
    margin-top: 12px; background: linear-gradient(120deg, var(--navy), var(--navy-light));
    border-radius: var(--radius); padding: 18px 18px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff; position: relative; overflow: hidden;
}
.promo-banner::before {
    content: ''; position: absolute; right: 90px; top: -30px;
    width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.05);
}
.promo-banner h3 { font-size: 16px; font-weight: 700; }
.promo-banner p { font-size: 12px; opacity: .7; margin-top: 3px; }
.promo-btn {
    position: relative; background: var(--primary); color: #fff;
    padding: 9px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; white-space: nowrap;
}

/* 持证专区 */
.license-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.license-card {
    background: var(--white); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow); border-top: 3px solid var(--primary);
}
.license-card.blue { border-top-color: #5b8def; }
.license-ico {
    width: 38px; height: 38px; border-radius: 10px; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); color: var(--primary);
}
.license-card.blue .license-ico { background: #eef4ff; color: #5b8def; }
.license-ico svg { width: 20px; height: 20px; }
.license-card h3 { font-size: 15px; color: var(--navy); font-weight: 700; }
.license-card p { font-size: 11px; color: var(--text-muted); margin: 5px 0 10px; line-height: 1.5; min-height: 32px; }
.license-card a { font-size: 12px; color: var(--primary); font-weight: 700; }
.license-card.blue a { color: #5b8def; }

/* 商家卡片 */
.merchant-card {
    background: var(--white); border-radius: var(--radius); padding: 14px;
    margin-bottom: 10px; box-shadow: var(--shadow);
    display: flex; gap: 12px; align-items: center;
}
.merchant-logo {
    width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 700;
}
.merchant-info { flex: 1; min-width: 0; }
.merchant-info h3 { font-size: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merchant-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin: 3px 0; }
.star { color: #ffb400; }
.cert-badge { background: #eaf7ef; color: #1f9d60; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.merchant-desc { font-size: 12px; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merchant-btn { background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 16px; flex-shrink: 0; }

/* 活动卡片 */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-card {
    background: var(--white); border-radius: var(--radius); padding: 14px;
    box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
}
.activity-date {
    width: 52px; flex-shrink: 0; text-align: center;
    background: var(--primary-light); border-radius: 10px; padding: 6px 0; color: var(--primary);
}
.activity-date .day { font-size: 20px; font-weight: 800; line-height: 1; }
.activity-date .mon { font-size: 11px; margin-top: 2px; }
.activity-body { flex: 1; min-width: 0; }
.activity-body h3 { font-size: 14px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-body .loc { font-size: 12px; color: var(--text-muted); margin: 3px 0; }
.activity-body .price { font-size: 13px; color: var(--primary); font-weight: 700; }
.activity-join { background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 16px; flex-shrink: 0; }

/* 信息流列表 */
.feed-list { display: flex; flex-direction: column; }
.feed-item {
    background: var(--white); padding: 14px; border-bottom: 1px solid var(--line);
    display: flex; gap: 12px;
}
.feed-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.feed-item:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.feed-thumb {
    width: 76px; height: 76px; border-radius: 10px; flex-shrink: 0;
    background: var(--bg); object-fit: cover;
    display: flex; align-items: center; justify-content: center; color: #c8d0dd;
}
.feed-thumb svg { width: 30px; height: 30px; }
.feed-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.top-tag { background: var(--primary); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; }
.feed-tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.feed-tags span { background: #f2f5fa; color: #7a869c; font-size: 10px; padding: 2px 7px; border-radius: 4px; }
.feed-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.feed-price { color: var(--primary); font-weight: 800; font-size: 16px; }
.feed-price small { font-size: 11px; font-weight: 500; }
.feed-meta { font-size: 11px; color: var(--text-muted); text-align: right; }

/* 筛选标签 */
.filter-bar {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 0;
    scrollbar-width: none; position: sticky; top: 62px; z-index: 30;
    background: var(--bg);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
    white-space: nowrap; padding: 7px 15px; border-radius: 18px;
    background: var(--white); color: var(--text-muted); font-size: 13px; border: 1px solid var(--line);
}
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 底部导航 */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    display: flex; padding-bottom: env(safe-area-inset-bottom);
    max-width: 640px; margin: 0 auto;
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 8px 0 6px; gap: 2px; color: var(--text-muted); font-size: 11px;
}
.tab.active { color: var(--primary); }
.tab svg { width: 22px; height: 22px; }
.tab-publish { position: relative; }
.tab-publish .pub-circle {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    margin-top: -18px; box-shadow: 0 4px 12px rgba(255,107,53,.4);
}
.tab-publish .pub-circle svg { width: 24px; height: 24px; }
.badge-dot { position: absolute; top: 4px; right: calc(50% - 18px); background: var(--primary); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; text-align: center; line-height: 16px; padding: 0 4px; }

/* 通用表单 */
.card { background: var(--white); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-top: 12px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-group label .req { color: var(--primary); }
.form-control {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line);
    border-radius: 9px; background: #fbfcfe; font-size: 14px; color: var(--text); transition: .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: 24px; font-size: 15px; font-weight: 700;
    background: var(--primary); color: #fff; transition: .2s;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-navy { background: var(--navy); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.img-upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.img-slot {
    aspect-ratio: 1; border: 2px dashed #d9e0ea; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #b0bac9; font-size: 28px; position: relative; overflow: hidden; cursor: pointer;
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; }
.img-slot .del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* 详情页 */
.detail-page { background: var(--white); min-height: 100vh; }
.detail-media { background: #eceff4; }
.detail-media img { width: 100%; max-height: 320px; object-fit: cover; }
.detail-media-empty { height: 200px; display: flex; align-items: center; justify-content: center; color: #c8d0dd; }
.detail-media-empty svg { width: 60px; height: 60px; }
.detail-main { padding: 18px 16px; }
.detail-price { color: var(--primary); font-size: 28px; font-weight: 800; }
.detail-price small { font-size: 14px; }
.detail-title { font-size: 19px; font-weight: 700; color: var(--navy); margin: 8px 0 12px; line-height: 1.5; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-tags span { background: var(--primary-light); color: var(--primary); font-size: 11px; padding: 3px 9px; border-radius: 5px; }
.detail-meta-row { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-desc { padding: 16px 0; font-size: 14px; line-height: 1.9; color: #4a5670; white-space: pre-wrap; }
.detail-section-title { font-size: 16px; font-weight: 700; color: var(--navy); margin: 20px 0 10px; }
.contact-card { background: var(--primary-light); border-radius: 12px; padding: 16px; }
.contact-card .name { font-size: 15px; font-weight: 700; color: var(--navy); }
.contact-card .phone { font-size: 22px; font-weight: 800; color: var(--primary); margin: 6px 0; }
.detail-action { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 70; max-width: 640px; margin: auto; }
.detail-action .fav-btn { width: 52px; border: 1px solid var(--line); border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--text-muted); }
.detail-action .fav-btn.on { color: var(--primary); border-color: var(--primary); }
.detail-action .fav-btn svg { width: 20px; height: 20px; }
.detail-action .main-btn { flex: 1; background: var(--primary); color: #fff; border-radius: 24px; font-weight: 700; font-size: 15px; }

/* 会员中心 */
.user-hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    padding: 30px 20px 50px; color: #fff; position: relative;
}
.user-hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 30px; background: var(--bg); border-radius: 30px 30px 0 0; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; border: 3px solid rgba(255,255,255,.3); }
.user-name { font-size: 18px; font-weight: 700; margin-top: 10px; }
.user-phone { font-size: 13px; opacity: .7; }
.user-stats { display: flex; background: var(--white); border-radius: var(--radius); margin: -36px 14px 0; padding: 16px 0; box-shadow: var(--shadow); position: relative; }
.user-stats > div { flex: 1; text-align: center; }
.user-stats .num { font-size: 20px; font-weight: 800; color: var(--navy); }
.user-stats .lbl { font-size: 12px; color: var(--text-muted); }
.menu-list { background: var(--white); border-radius: var(--radius); margin: 12px 14px; box-shadow: var(--shadow); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item .mi { width: 26px; height: 26px; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.menu-item .mi svg { width: 20px; height: 20px; }
.menu-item .arrow { margin-left: auto; color: #c2cad6; font-size: 18px; }

/* 列表项（我的发布） */
.my-item { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); }
.my-item .mi-body { flex: 1; min-width: 0; }
.my-item h4 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.my-item .meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.status-1 { background: #eaf7ef; color: #1f9d60; }
.status-0 { background: #fff4e5; color: #d98300; }
.status-2 { background: #ffeceb; color: #d6453a; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty svg { width: 64px; height: 64px; color: #d6dde8; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* 消息 */
.msg-item { display: flex; gap: 12px; padding: 14px; background: #fff; border-bottom: 1px solid var(--line); }
.msg-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-body .top { display: flex; justify-content: space-between; align-items: center; }
.msg-body .name { font-weight: 700; font-size: 14px; }
.msg-body .time { font-size: 11px; color: var(--text-muted); }
.msg-body .content { font-size: 13px; color: #6b7690; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }

/* 提示条 */
.toast {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(26,43,74,.9); color: #fff; padding: 12px 24px;
    border-radius: 10px; font-size: 14px; z-index: 200; opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; }

/* 通用标题栏（非首页） */
.pagebar {
    position: sticky; top: 0; z-index: 50; background: #fff;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
    display: flex; align-items: center; border-bottom: 1px solid var(--line);
}
.pagebar .back { font-size: 22px; width: 30px; color: var(--navy); }
.pagebar h1 { flex: 1; text-align: center; font-size: 17px; font-weight: 700; color: var(--navy); }
.pagebar .right { width: 30px; text-align: right; font-size: 14px; color: var(--primary); }

/* 登录注册 */
.auth-page { min-height: 100vh; background: linear-gradient(160deg, var(--navy), var(--navy-light) 40%, var(--bg) 40%); }
.auth-card { background: #fff; border-radius: 20px 20px 0 0; min-height: 62vh; margin-top: 90px; padding: 30px 24px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .lg { width: 56px; height: 56px; border-radius: 16px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.auth-logo h1 { font-size: 20px; margin-top: 10px; color: var(--navy); }
.auth-tabs { display: flex; gap: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-tabs a { padding-bottom: 10px; font-size: 16px; color: var(--text-muted); position: relative; }
.auth-tabs a.active { color: var(--primary); font-weight: 700; }
.auth-tabs a.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 3px; }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 20px; }
.pager a, .pager span { padding: 8px 16px; border-radius: 8px; font-size: 13px; background: #fff; border: 1px solid var(--line); }
.pager span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 提示消息条 */
.flash-msg { max-width: 640px; margin: 12px auto 0; padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.flash-success { background: #eaf7ef; color: #1f9d60; }
.flash-error { background: #ffeceb; color: #c0392b; }

@media (min-width: 641px) {
    body { padding-top: 0; }
    .appbar, .tabbar, .pagebar { max-width: 640px; left: 0; right: 0; margin: 0 auto; }
}
