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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px; /* 增加最大宽度以更好利用大屏幕 */
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    background-color: #4285f4;
    color: white;
    padding: 15px;
    border-radius: 8px;
}

.header-controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

h1 {
    font-size: 24px;
    font-weight: 500;
}

h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #555;
}

.status {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.location-info, #nearby-places {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.place-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.place-info {
    flex: 1;
}

.place-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.place-distance {
    font-size: 14px;
    color: #666;
}

.nav-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.hidden {
    display: none;
}

#refresh-btn {
    display: block;
    width: 100%;
    background-color: #34a853;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#refresh-btn:hover {
    background-color: #2d9249;
}

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

#map-container {
    width: 100%;
    height: 85vh; /* 使用视口高度的85% */
    min-height: 600px; /* 最小高度600px */
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 最大化地图模式 */
.map-maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* 最大化模式下的控制面板 */
.map-controls-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

.map-controls-overlay h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.overlay-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overlay-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.exit-maximize-btn {
    background-color: #f44336;
    color: white;
}

.exit-maximize-btn:hover {
    background-color: #d32f2f;
}

/* 全屏地图样式 */
.map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* 全屏按钮样式 */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.fullscreen-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.fullscreen-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.map-redirect {
    text-align: center;
    padding: 15px;
}

.map-redirect p {
    margin: 10px 0;
}

.map-redirect img {
    margin: 15px 0;
}

.place-address {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    margin-bottom: 4px;
}

.place-hours-toggle {
    font-size: 13px;
    color: #4285f4;
    cursor: pointer;
    margin-top: 4px;
    text-decoration: underline;
}

.place-hours {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    padding: 5px;
    background-color: #f9f9f9;
    border-radius: 4px;
    line-height: 1.4;
}

.city-tag {
    background-color: #ff9800;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 5px;
}

#toggle-container {
    margin-bottom: 15px;
}

.toggle-buttons {
    display: flex;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    margin: 0 auto;
    width: fit-content;
}

.toggle-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.toggle-btn.active {
    background-color: #4285f4;
    color: white;
    font-weight: 500;
}

/* 地址输入相关样式 */
.address-input-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.address-input-group {
    margin-bottom: 15px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-number {
    min-width: 20px;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.address-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.address-input:focus {
    outline: none;
    border-color: #4285f4;
}

.remove-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background-color: #d32f2f;
}

.input-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.add-btn, .mark-btn, .clear-btn, .view-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.add-btn {
    background-color: #4CAF50;
    color: white;
}

.add-btn:hover {
    background-color: #45a049;
}

.mark-btn {
    background-color: #4285f4;
    color: white;
}

.mark-btn:hover {
    background-color: #3367d6;
}

.clear-btn {
    background-color: #ff9800;
    color: white;
}

.clear-btn:hover {
    background-color: #f57c00;
}

.view-btn {
    background-color: #9c27b0;
    color: white;
}

.view-btn:hover {
    background-color: #7b1fa2;
}

/* 已标记地址列表样式 */
.marked-address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.marked-address-item:last-child {
    border-bottom: none;
}

.address-info {
    flex: 1;
}

.address-number {
    font-weight: 500;
    color: #4285f4;
    margin-bottom: 5px;
}

.address-text {
    font-size: 14px;
    margin-bottom: 3px;
}

.address-coords {
    font-size: 12px;
    color: #666;
}

.locate-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.locate-btn:hover {
    background-color: #3367d6;
}

/* 加载动画样式 */
.loading {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .toggle-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .input-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .address-input {
        min-width: 200px;
    }
    
    .input-controls {
        justify-content: center;
    }
    
    .add-btn, .mark-btn, .clear-btn, .view-btn {
        flex: 1;
        min-width: 80px;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    #map-container {
        height: 75vh; /* 在移动设备上增加高度 */
        min-height: 500px;
    }
    
    .fullscreen-btn {
        top: 5px;
        right: 5px;
        padding: 6px;
    }
    
    .fullscreen-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .map-controls-overlay {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 10px;
    }
    
    .overlay-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .overlay-btn {
        flex: 1;
        min-width: 80px;
        font-size: 11px;
        padding: 6px 8px;
    }
}