/* ==================== 设计系统 ==================== */
:root {
    /* 主色调 - 暖铜橙 */
    --primary: #c96b3c;
    --primary-dark: #a85530;
    --primary-light: #e8956a;
    --primary-bg: #fef6f0;
    
    /* 强调色 - 琥珀金 */
    --accent: #c9963c;
    --accent-dark: #a87d30;
    --accent-light: #e8b86a;
    --accent-bg: #fef8ef;
    
    /* 语义色 */
    --success: #3d9e6b;
    --success-bg: #eef8f2;
    --warning: #c9963c;
    --warning-bg: #fef8ef;
    --danger: #c95c3c;
    --danger-bg: #fef0ed;
    --info: #4a8eb5;
    --info-bg: #eef4f9;
    
    /* 文字色 */
    --text-primary: #1a1512;
    --text-secondary: #5c4f44;
    --text-tertiary: #8c7e72;
    --text-placeholder: #b8ada3;
    
    /* 背景色 */
    --bg-body: #faf7f4;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-muted: #f5f0eb;
    --bg-hover: #f9f4ef;
    
    /* 边框色 */
    --border-light: #ede6de;
    --border-default: #e0d6cc;
    --border-strong: #cfc3b5;
    
    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(26,21,18,0.04);
    --shadow-sm: 0 1px 4px rgba(26,21,18,0.06), 0 0 1px rgba(26,21,18,0.04);
    --shadow-md: 0 4px 12px rgba(26,21,18,0.07), 0 0 1px rgba(26,21,18,0.04);
    --shadow-lg: 0 8px 24px rgba(26,21,18,0.1), 0 0 1px rgba(26,21,18,0.04);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none;
}

/* 禁止长按选中（移动端体验） */
.point-card, .district-btn, .btn-nav, .btn-call {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==================== 顶部 ==================== */
.header {
    background: linear-gradient(160deg, #d4855a 0%, #c96b3c 40%, #b85a30 100%);
    color: #fff;
    padding: 18px 20px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(201,107,60,0.25);
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.header-inner {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #fff;
}

.subtitle {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ==================== 主内容 ==================== */
.main-content {
    max-width: 768px;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* ==================== 定位栏 ==================== */
.location-bar {
    background: var(--bg-card);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.location-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.location-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.location-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.location-text.loading {
    color: var(--text-tertiary);
    font-weight: 400;
}

.location-text.success {
    color: var(--success);
    font-weight: 500;
}

.location-text.error {
    color: var(--danger);
    font-weight: 400;
}

.btn-retry {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-retry:active {
    background: var(--primary);
    color: #fff;
}

/* ==================== 标签栏 ==================== */
.tab-bar {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 52px;
    z-index: 90;
}

.tab-btn {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
    letter-spacing: 0.5px;
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

/* ==================== 标签面板 ==================== */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ==================== 地图 ==================== */
.map-container {
    width: 100%;
    height: 280px;
    background: var(--bg-muted);
    position: relative;
    overflow: hidden;
}

.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-size: 14px;
    gap: 6px;
}

/* ==================== 附近区域 ==================== */
.nearby-section {
    padding: 14px 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.title-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.title-count {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-left: auto;
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* ==================== 列表项 ==================== */
.point-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.point-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.point-card:active {
    transform: scale(0.985);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.point-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.point-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.point-address, .point-phone, .point-type, .point-distance {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

.point-address svg,
.point-phone svg {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.point-type-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.tag-urban {
    background: var(--info-bg);
    color: var(--info);
}

.tag-rural {
    background: var(--success-bg);
    color: var(--success);
}

.tag-both {
    background: var(--warning-bg);
    color: var(--accent-dark);
}

.tag-registration {
    background: var(--primary-bg);
    color: var(--primary);
}

.point-distance {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
}

.point-distance svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.point-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.btn-nav, .btn-call {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
}

.btn-nav svg, .btn-call svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn-nav {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.btn-nav:active {
    background: linear-gradient(135deg, var(--primary-dark), #8f4520);
    transform: scale(0.97);
}

.btn-call {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.btn-call:active {
    background: var(--border-light);
    transform: scale(0.97);
}

/* ==================== 按区查询 ==================== */
.search-bar {
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--bg-muted);
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--primary-light);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(201,107,60,0.1);
}

.search-input::placeholder {
    color: var(--text-placeholder);
}

.search-bar {
    position: relative;
}

.search-bar::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238c7e72' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}

.search-results {
    padding: 0 16px;
}

.district-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
}

.district-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.district-btn:active {
    transform: scale(0.95);
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.district-btn:active .district-name,
.district-btn:active .district-count {
    color: #fff;
}

.district-btn .district-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    letter-spacing: 0.5px;
}

.district-btn .district-count {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 3px;
    display: block;
    font-weight: 400;
}

.district-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.btn-back {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

.district-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==================== 底部 ==================== */
.footer {
    text-align: center;
    padding: 24px 16px 36px;
    background: var(--bg-card);
    margin-top: 12px;
    border-top: 1px solid var(--border-light);
}

.footer-notice {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.8;
    font-weight: 400;
}

.footer-link {
    font-size: 13px;
    color: var(--primary);
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26,21,18,0.45);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 768px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -4px 24px rgba(26,21,18,0.12);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border-default);
    border-radius: 2px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-muted);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.modal-close:active {
    background: var(--border-light);
}

.modal-body .point-name {
    font-size: 18px;
    margin-bottom: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.modal-body .point-info {
    font-size: 14px;
    gap: 8px;
}

.modal-body .point-actions {
    margin-top: 20px;
    padding-top: 16px;
}

.modal-body .btn-nav,
.modal-body .btn-call {
    padding: 12px 0;
    font-size: 15px;
    border-radius: var(--radius-sm);
}

/* ==================== 加载/空状态 ==================== */
.loading-hint {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.7;
}

.empty-hint {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.7;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 2px;
}

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
    .map-container {
        height: 400px;
    }
    
    .district-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 375px) {
    .district-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .point-actions {
        flex-direction: column;
    }
}
