* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#mapContainer {
    width: 100%;
    height: 100%;
}

/* 顶部栏 */
.top-bar {
    position: absolute;
    top: var(--status-bar-height, 12px);
    left: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 关闭按钮 */
.close-btn {
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.close-btn:active {
    background: #f5f5f5;
}

/* 搜索框 */
.search-box {
    flex: 1;
    min-width: 0;
    display: flex;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-box input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:active {
    background: #f5f5f5;
}

/* 中心点标记 */
.center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 99;
    pointer-events: none;
}

.marker-icon {
    width: 30px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    box-shadow: 0 3px 10px rgba(238, 90, 90, 0.4);
}

.marker-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
}

.marker-icon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #ee5a5a;
}

.marker-shadow {
    width: 20px;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    margin: 8px auto 0;
}

/* 定位按钮 */
.location-btn {
    position: absolute;
    right: 16px;
    bottom: 180px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    z-index: 100;
}

.location-btn:active {
    background: #f5f5f5;
}

.location-btn.locating {
    color: #4CAF50;
}

/* 搜索结果列表 */
.search-results {
    position: absolute;
    top: 76px;
    left: 72px;
    right: 16px;
    max-height: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 100;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: #f5f5f5;
}

.result-name {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.result-address {
    font-size: 13px;
    color: #999;
}

/* 底部地点信息 */
.location-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.info-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
}

.poi-icon {
    width: 40px;
    height: 40px;
    background: #f0f7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1890ff;
    flex-shrink: 0;
}

.poi-details {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.poi-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poi-address {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tip-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff8e6;
    color: #fa8c16;
    font-size: 13px;
}

.close-tip {
    background: none;
    border: none;
    color: #fa8c16;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

/* 底部周边POI列表 */
.nearby-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 40vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.nearby-panel.hidden {
    display: none;
}

.nearby-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.nearby-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}

.nearby-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nearby-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
}

.nearby-item:active {
    background: #f5f5f5;
}

.nearby-item-index {
    width: 22px;
    height: 22px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.nearby-item-info {
    flex: 1;
    min-width: 0;
}

.nearby-item-name {
    font-size: 15px;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nearby-item-address {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 调试开关 */
.debug-toggle-btn {
    position: absolute;
    right: 16px;
    bottom: 236px;
    height: 32px;
    min-width: 54px;
    border: none;
    border-radius: 16px;
    padding: 0 12px;
    background: #1f6fff;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(31, 111, 255, 0.35);
    z-index: 101;
}

.debug-toggle-btn.active {
    background: #0f172a;
}

.debug-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 248px;
    max-height: 38vh;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.94);
    color: #dbeafe;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
    z-index: 102;
}

.debug-panel.hidden {
    display: none;
}

.debug-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.debug-clear-btn {
    border: 1px solid rgba(191, 219, 254, 0.45);
    background: transparent;
    color: #bfdbfe;
    border-radius: 6px;
    height: 24px;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
}

.debug-content {
    max-height: calc(38vh - 44px);
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.debug-line {
    margin-bottom: 6px;
}

.debug-line .debug-time {
    color: #93c5fd;
    margin-right: 6px;
}

/* 加载动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading .poi-name,
.loading .poi-address {
    animation: pulse 1.5s infinite;
}

/* 调试按钮 */
.debug-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #0f0;
    border: none;
    font-size: 14px;
    font-weight: bold;
    z-index: 10000;
    -webkit-tap-highlight-color: transparent;
}

/* 浮动日志面板 */
.log-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: monospace;
    font-size: 11px;
}

.log-panel.hidden {
    display: none;
}

.log-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: #0f0;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.log-clear-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    color: #0f0;
    white-space: pre-wrap;
    word-break: break-all;
}

