/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --success-color: #5cb85c;
    --danger-color: #d9534f;
    --warning-color: #f0ad4e;
    --dark-bg: #1a1a2e;
    --light-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e1e8ed;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    overflow: hidden;
}

/* 容器布局 */
.container {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 380px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 统计面板 */
.stats-panel {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.stats-panel h2 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(74, 144, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.stat-card.highlight .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

/* 合并统计卡片样式 */
.stat-card.combined .stat-values {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.stat-card.combined .stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0;
}

.stat-separator {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.6;
    color: var(--text-secondary);
}

.stat-card.combined .stat-label {
    font-size: 12px;
    opacity: 0.8;
}

/* 进度条 */
.progress-section {
    margin-top: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

#progressText {
    font-weight: 600;
    color: var(--primary-color);
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* 城市面板 */
.cities-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cities-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.cities-header h2 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.cities-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.cities-list::-webkit-scrollbar {
    width: 6px;
}

.cities-list::-webkit-scrollbar-track {
    background: transparent;
}

.cities-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.cities-list::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 13px;
    opacity: 0.8;
}

.city-item {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.city-item:hover {
    background: #e8f0fe;
    transform: translateX(4px);
}

.city-flag {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

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

.city-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-country {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.city-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.city-item:hover .city-actions {
    opacity: 1;
}

.city-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.city-action-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* 操作按钮 */
.action-buttons {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* 地图容器 */
.map-container {
    flex: 1;
    position: relative;
}

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

/* 地图控制按钮 */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 12px 20px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--light-bg);
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: var(--shadow);
}

.suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.suggestion-item:hover {
    background: var(--light-bg);
}

.suggestion-item small {
    color: var(--text-secondary);
    margin-left: 8px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 导出选项 */
.export-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.export-option {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.export-option:hover {
    border-color: var(--primary-color);
    background: #e8f0fe;
    transform: translateY(-4px);
}

.export-option i {
    font-size: 32px;
    color: var(--primary-color);
}

.export-option span {
    font-size: 14px;
    font-weight: 500;
}

/* 星星标记样式 */
.star-marker {
    background: transparent;
    border: none;
}

.star-icon {
    font-size: 28px;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: starPulse 2s ease-in-out infinite;
}

.star-icon:hover {
    transform: scale(1.3) rotate(15deg);
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.6));
}

/* 星星脉动动画 */
@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 35vh;
    }
    
    .map-container {
        height: 65vh;
    }
    
    .stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .stat-card {
        padding: 6px;
        gap: 4px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-card.combined .stat-value {
        font-size: 16px;
    }
    
    .stat-separator {
        font-size: 12px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .progress-section {
        margin-top: 6px;
    }
    
    .progress-label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    /* 移动端隐藏已访问城市模块 */
    .cities-panel {
        display: none;
    }
    
    /* 移动端优化操作按钮 */
    .action-buttons {
        gap: 8px;
	padding: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .btn i {
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-item {
    animation: fadeIn 0.3s ease;
}

/* Leaflet 自定义样式 */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 4px;
}

.leaflet-popup-content {
    margin: 12px;
    font-size: 14px;
}

.leaflet-popup-content h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
}

.leaflet-popup-content p {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 城市覆盖圆形动画 */
.leaflet-interactive {
    transition: all 0.3s ease;
}

.leaflet-interactive:hover {
    opacity: 0.8;
}

/* 新添加城市的脉动动画 */
@keyframes cityPulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

.city-pulse {
    animation: cityPulse 1.5s ease-in-out 2;
}

/* 地图图例 */
.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 1000;
    font-size: 13px;
    transition: all 0.3s ease;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px 16px;
    cursor: pointer;
    user-select: none;
}

.legend-header:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px 12px 0 0;
}

.map-legend h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.legend-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.legend-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.legend-content {
    padding: 0 16px 16px 16px;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

.legend-content.collapsed {
    max-height: 0;
    padding: 0 16px;
    opacity: 0;
}

.legend-content.expanded {
    max-height: 500px;
    padding: 0 16px 16px 16px;
    opacity: 1;
}

.map-legend.collapsed .legend-toggle i {
    transform: rotate(180deg);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.legend-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.legend-circle.large {
    width: 24px;
    height: 24px;
}

.legend-circle.medium {
    width: 20px;
    height: 20px;
}

.legend-circle.small {
    width: 16px;
    height: 16px;
}

.legend-text {
    color: var(--text-secondary);
}

/* 帮助弹窗样式 */
.help-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.help-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.help-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h3 i {
    color: var(--primary-color);
    font-size: 18px;
}

.help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-section ul li {
    padding: 6px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-section ul li strong {
    color: var(--text-primary);
}

.help-section ul li i {
    font-size: 12px;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section p i {
    font-size: 16px;
    flex-shrink: 0;
}

.contact-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 8px;
    border: none;
}

.contact-section h3 {
    color: var(--primary-color);
}

.contact-email {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.contact-email:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 响应式帮助弹窗 */
@media (max-width: 768px) {
    .help-section h3 {
        font-size: 15px;
    }
    
    .help-section ul li {
        font-size: 13px;
    }
    
    .help-section p {
        font-size: 13px;
    }
}


