/* 移动优先 — 375px 基准 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* 顶部筛选栏 */
.filter-bar {
    position: sticky; top: 0; z-index: 10;
    background: #fff; padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.filter-bar select, .filter-bar input {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 14px; outline: none;
}
.filter-bar select { min-width: 100px; }
.filter-bar input { flex: 1; min-width: 120px; }
.filter-bar select:focus, .filter-bar input:focus { border-color: #1677ff; }

/* 状态按钮组 */
.status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.status-btn {
    padding: 6px 14px; border: 1px solid #ddd; border-radius: 20px;
    background: #fff; font-size: 13px; cursor: pointer;
    white-space: nowrap; user-select: none;
}
.status-btn.active { background: #1677ff; color: #fff; border-color: #1677ff; }

/* 卡片列表 */
.card-list { padding: 12px 16px; }
.contact-card {
    background: #fff; border-radius: 10px; padding: 14px 16px;
    margin-bottom: 10px; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
}
.contact-card:active { background: #f0f0f0; }

.card-left { flex: 1; min-width: 0; }
.card-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.card-location { font-size: 13px; color: #888; margin-bottom: 2px; }
.card-phone { font-size: 13px; color: #666; }
.card-meta { font-size: 12px; color: #aaa; margin-top: 2px; }

.card-right { text-align: right; flex-shrink: 0; }
.tier-badge {
    display: inline-block; padding: 4px 12px; border-radius: 12px;
    font-size: 14px; font-weight: 600; color: #fff;
}
.tier-A { background: #e6a817; }
.tier-B { background: #f08a24; }
.tier-C { background: #1677ff; }
.tier-no_answer { background: #999; }
.tier-pending { background: #52c41a; }
.tier-dialed { background: #999; }
.tier-dialing { background: #faad14; }

/* 加载更多 */
.load-more {
    text-align: center; padding: 16px; color: #1677ff;
    cursor: pointer; user-select: none;
}
.load-more:active { color: #0958d9; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* 头部导航 */
.header {
    background: #1677ff; color: #fff; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header a { color: #fff; text-decoration: none; font-size: 14px; opacity: 0.85; }

/* 对话气泡 */
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 12px; margin-bottom: 6px; font-size: 14px; line-height: 1.6; }
.bubble.ai { background: #f0f0f0; margin-right: auto; border-bottom-left-radius: 2px; }
.bubble.customer { background: #95ec69; margin-left: auto; border-bottom-right-radius: 2px; text-align: right; }
.bubble-label { font-size: 11px; color: #aaa; margin-bottom: 2px; }

/* 意图标签 */
.intent-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.intent-tag { padding: 2px 10px; background: #e6f0ff; color: #1677ff; border-radius: 10px; font-size: 12px; }

/* 退出按钮 */
.btn-logout {
    color: #fff; text-decoration: none; font-size: 14px; opacity: 0.85; cursor: pointer;
    background: none; border: 1px solid rgba(255,255,255,0.4); padding: 4px 12px; border-radius: 4px;
}
.btn-logout:active { background: rgba(255,255,255,0.15); }

/* 底部 Tab 栏 */
.tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: flex; background: #fff; border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: 8px 0 4px; text-decoration: none; color: #999;
    font-size: 11px; -webkit-tap-highlight-color: transparent;
}
.tab-item .tab-icon { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.tab-item .tab-label { line-height: 1; }
.tab-item.active { color: #1677ff; }

/* 有 Tab 的页面底部留白，防止内容被遮挡 */
body.has-tab { padding-bottom: 64px; }

/* 高德导入 */
.autocomplete-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 6px 6px; z-index: 20; max-height: 200px; overflow-y: auto;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
    padding: 10px 12px; cursor: pointer; font-size: 14px;
    display: flex; justify-content: space-between;
}
.autocomplete-item:active, .autocomplete-item:hover { background: #f0f0f0; }
.autocomplete-item .ac-city { color: #333; }
.autocomplete-item .ac-province { color: #888; font-size: 12px; }

.keyword-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.keyword-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: #e6f0ff; color: #1677ff;
    border-radius: 16px; font-size: 13px;
}
.keyword-tag .tag-remove { cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.5; }
.keyword-tag .tag-remove:active { opacity: 1; }

.search-result { margin-top: 16px; border-top: 1px solid #eee; padding-top: 12px; }
.search-result-header { font-size: 14px; color: #333; margin-bottom: 8px; }
.progress-log {
    margin-bottom: 8px; padding: 8px 10px; background: #f9f9f9;
    border-radius: 6px; font-size: 12px; color: #888; line-height: 1.8;
}
.progress-log.show { display: block; }
.search-preview-item {
    padding: 10px 0; border-bottom: 1px solid #f5f5f5;
    font-size: 13px; line-height: 1.6;
}
.search-preview-item .sp-name { font-weight: 600; }
.search-preview-item .sp-phone { color: #1677ff; }
.search-preview-item .sp-addr { color: #888; }
.search-preview-item .sp-meta { color: #aaa; font-size: 12px; }

.btn-sm { padding: 6px 12px; font-size: 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; cursor: pointer; }
.btn-sm:active { background: #f0f0f0; }
