/* === 基础重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; overflow: hidden; }
.hidden { display: none !important; }

/* === 地图 === */
#map {
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* === 顶部状态栏 === */
#topBar {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
#topBar > * { pointer-events: auto; }

.level-badge {
    background: rgba(0,0,0,0.7);
    color: #FFD700;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: bold;
}

.spacer { flex: 1; }

.currency-badge {
    background: rgba(255,255,255,0.92);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #B8860B;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.currency-badge.diamond { color: #2196F3; }
.emoji { font-size: 16px; }

/* === 速度指示器 === */
#speedBadge {
    position: fixed;
    bottom: 90px;
    left: 16px;
    z-index: 1000;
    background: rgba(255,255,255,0.9);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* === 底部导航 === */
#bottomBar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e0e0e0;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
}
.nav-btn:active { transform: scale(0.92); background: #f0f0f0; }
.nav-icon { font-size: 24px; }
.nav-label { font-size: 10px; color: #666; margin-top: 2px; }

/* === 侧边面板 === */
#sidePanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.25s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.panel-header h2 { font-size: 18px; }
.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
}
.close-btn:hover { color: #333; }

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* === 任务卡片 === */
.task-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #4CAF50;
}
.task-card.completed { border-left-color: #FF9800; opacity: 0.8; }
.task-card.claimed { border-left-color: #ccc; opacity: 0.5; }
.task-title { font-weight: bold; font-size: 15px; }
.task-desc { color: #666; font-size: 13px; margin-top: 4px; }
.task-progress {
    margin-top: 8px;
    background: #e0e0e0;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}
.task-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 8px;
    transition: width 0.3s;
}
.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
}
.task-reward { color: #B8860B; }

/* === 房产卡片 === */
.property-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #2196F3;
}
.property-card .prop-name { font-weight: bold; font-size: 15px; }
.property-card .prop-type {
    display: inline-block;
    background: #E3F2FD;
    color: #1565C0;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    margin-left: 6px;
}
.property-card .prop-rent { color: #4CAF50; font-size: 13px; margin-top: 6px; }

/* === 车辆卡片 === */
.vehicle-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #FF9800;
    cursor: pointer;
    transition: all 0.2s;
}
.vehicle-card:active { transform: scale(0.98); background: #f0f0f0; }
.vehicle-card .v-name { font-weight: bold; font-size: 15px; }
.vehicle-card .v-info { color: #666; font-size: 13px; margin-top: 4px; }
.vehicle-card .v-price { color: #B8860B; font-size: 14px; margin-top: 4px; }

/* === 按钮 === */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-sm {
    padding: 4px 12px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
}
.btn-collect {
    background: #4CAF50;
    color: #fff;
}
.btn-collect:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.btn-buy {
    background: #FF9800;
    color: #fff;
}
.btn-claim {
    background: #2196F3;
    color: #fff;
}

/* === 模态框 === */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    width: 360px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.modal-content h2 { font-size: 24px; margin-bottom: 8px; }
.modal-subtitle { color: #666; font-size: 14px; margin-bottom: 20px; }
.modal-content input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.modal-content input:focus { border-color: #4CAF50; }
.divider {
    margin: 16px 0;
    color: #ccc;
    font-size: 13px;
    position: relative;
}

/* === 个人中心 === */
.profile-section {
    text-align: center;
    padding: 20px 0;
}
.profile-avatar { font-size: 64px; }
.profile-name { font-size: 20px; font-weight: bold; margin-top: 8px; }
.profile-level { color: #FF9800; font-size: 14px; margin-top: 4px; }
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}
.stat-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.stat-value { font-size: 20px; font-weight: bold; color: #333; }
.stat-label { font-size: 11px; color: #999; margin-top: 4px; }

/* === Toast === */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 4000;
    animation: toastIn 0.3s;
    white-space: nowrap;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === 附近房产标记弹窗 === */
.leaflet-popup-content { font-size: 13px; }
.popup-title { font-weight: bold; font-size: 14px; }
.popup-info { color: #666; margin: 4px 0; }
.popup-price { color: #B8860B; font-weight: bold; }

/* === 响应式 === */
@media (max-width: 480px) {
    #sidePanel { width: 100vw; }
    .currency-badge { padding: 4px 10px; font-size: 12px; }
    .level-badge { padding: 3px 8px; font-size: 12px; }
}
