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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1001;
}

#header h1 {
    font-size: 1.4em;
    margin-bottom: 6px;
}

#current-question {
    font-size: 1.1em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

#stats {
    margin-top: 6px;
    font-size: 0.85em;
}

#map {
    height: calc(100vh - 120px);
    width: 100%;
}

#buttons {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn {
    padding: 12px 30px;
    font-size: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#next-btn {
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    color: white;
}

#show-answer-btn {
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
}

/* Cheat mode 样式 */
#cheat-mode-container {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1001;
}

#cheat-toggle {
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    color: white;
    padding: 9px 11px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#cheat-toggle.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

#cheat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* Help按钮样式 */
#help-button-container {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    display: flex;
    gap: 10px;
}

#help-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#help-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* 城市名称标签 */
.city-label {
    color: black;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
}

/* 自定义标记样式 */
.city-marker {
    background: white;
    border: 2.5px solid #333;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    will-change: transform;
}

.city-marker:hover {
    transform: scale(1.3);
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
    background-color: white;
}

/* 正确答案标记 */
.correct-marker {
    background: #4CAF50;
    border-color: #2E7D32;
    width: 25px;
    height: 25px;
    animation: pulse 0.5s ease;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 错误答案标记 */
.wrong-marker {
    background: #f44336;
    border-color: #c62828;
    width: 25px;
    height: 25px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

/* Popup样式 */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow: hidden;
}

.leaflet-popup-content {
    font-size: 14px;
    margin-right: 12px;
    margin-left: 12px;
    line-height: 1.6;
    max-width: 300px;
    padding: 10px;
}

/* 增大关闭按钮 */
.leaflet-popup-close-button {
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1;
    transform: translateX(-110%) translateY(60%);
}

/* 自定义滚动条样式 */
.leaflet-popup-content::-webkit-scrollbar {
    width: 6px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.info-popup h3 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 18px;
    margin: 0 0 8px 0;
}

.info-popup p {
    color: #555;
    text-align: justify;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    line-height: 1.8;
    margin: 0;
}

.info-popup .info-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
    border-radius: 6px;
}

/* 模态弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-content h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

.modal-content a {
    color: #667eea;
    text-decoration: underline;
    font-weight: bold;
}

.modal-content a:hover {
    color: #764ba2;
}

/* 自定义Radio Button样式 */
.custom-radio-group {
    background: white;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 5px 0;
    margin-top: 5px;
    margin-bottom: 8px;
}

.custom-radio-option {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 13px;
}

.custom-radio-option:hover {
    background: #f0f0f0;
}

.custom-radio-option.active {
    background: #666;
    color: white;
}

.custom-radio-option input[type="radio"] {
    margin: 0 6px 0 0;
    cursor: pointer;
}

.custom-radio-option label {
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.custom-radio-title {
    font-size: 11px;
    color: #666;
    padding: 3px 10px;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #ccc;
}

/* 筛选控件样式 */
#filter-control-container {
    position: fixed;
    top: 12px;
    left: 50px;
    z-index: 1001;
}

#filter-toggle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

#filter-panel {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    z-index: 1002;
}

#filter-panel.show {
    display: block;
}

.filter-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 10px;
}

.filter-tab {
    flex: 1;
    padding: 8px 12px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: #f0f0f0;
}

.filter-tab.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.filter-content {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: #f5f5f5;
}

.filter-option.selected {
    background: #667eea;
    color: white;
}

.filter-option input[type="checkbox"] {
    margin: 0 8px 0 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-count {
    margin-left: auto;
    color: #999;
    font-size: 12px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.filter-option.selected .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .leaflet-popup-content-wrapper {
        max-width: 85vw;
    }

    .leaflet-popup-content {
        max-width: 85vw;
        font-size: 13px;
        max-height: 300px;
    }

    .leaflet-popup-close-button {
        padding: 10px 14px;
        font-size: 24px;
    }

    .info-popup h3 {
        font-size: 16px;
    }

    /* 优化attribution在移动端的显示 */
    .leaflet-control-attribution {
        font-size: 6px;
        padding: 2px 4px;
    }

    .leaflet-control-attribution a {
        font-size: 6px;
    }

    .info-popup p {
        font-size: 12px;
    }
    .city-marker {
        background: white;
        border: 2px solid #333;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        cursor: pointer;
        transition: background-color 0.3s ease, border-color 0.3s ease;
        will-change: transform;
    }
}
