/* 全局样式变量 - 紫色/蓝色渐变主题 */
:root {
    /* 主色调 - 紫色系 */
    --primary-purple: #7B68EE;
    --primary-purple-dark: #6356E8;
    --primary-purple-light: #9B8EF0;
    
    /* 蓝色系 */
    --accent-blue: #4F46E5;
    --accent-blue-light: #818CF8;
    --accent-blue-dark: #3730A3;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #7B68EE 0%, #4F46E5 100%);
    --gradient-secondary: linear-gradient(135deg, #6356E8 0%, #3730A3 100%);
    --gradient-light: linear-gradient(135deg, #F8F7FF 0%, #F0F9FF 100%);
    --gradient-dark: linear-gradient(135deg, #1A1B3A 0%, #1E293B 100%);
    --gradient-accent: linear-gradient(135deg, #9B8EF0 0%, #818CF8 100%);
    
    /* 中性色 */
    --white: #FFFFFF;
    --gray-50: #F8F9FF;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* 状态色 */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #3B82F6;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* 圆角 */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* 过渡动画 */
    --transition: all 0.2s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--gradient-light);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 页面容器 */
.container-fluid {
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    border: none;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 2rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gray-800) !important;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 品牌图标样式 */
.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Toast提示容器样式 */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: auto;
    max-width: 500px;
}

.toast-container .alert {
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    background: var(--white);
    text-align: center;
    font-weight: 500;
    color: var(--gray-800);
}

.toast-container .alert-success {
    border-left: 4px solid var(--success-color);
    background: var(--white);
    color: var(--success-color);
}

.navbar-nav .nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
    margin: 0 0.25rem;
    position: relative;
    overflow: hidden;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: #4F46E5 !important;
}

.navbar-nav .nav-link:hover::before {
    width: 80%;
}

/* 导航栏积分显示样式 */
.navbar-nav .nav-link:not([href]),
.navbar-nav span.nav-link {
    background: var(--gradient-light);
    color: var(--gray-700) !important;
    border: 1px solid var(--gray-200);
    font-weight: 600;
    cursor: default;
}

.navbar-nav .nav-link:not([href]):hover,
.navbar-nav span.nav-link:hover {
    background: var(--gradient-light);
    transform: none;
}

.navbar-nav .nav-link:not([href])::before,
.navbar-nav span.nav-link::before {
    display: none;
}

/* 主内容区布局 */
.main-content {
    display: flex;
    height: calc(100vh - 76px);
    background: var(--white);
}

/* 地图区域 */
.map-section {
    flex: 1;
    position: relative;
    background: var(--gray-100);
}

#map-container {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
}

/* 右侧面板 */
.sidebar {
    width: 400px;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* 筛选器区域 */
.filter-section {
    border-bottom: 1px solid var(--gray-200);
    background: var(--gradient-light);
}

.filter-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.filter-header:hover {
    background: rgba(123, 104, 238, 0.05);
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle-icon {
    color: var(--gray-500);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.filter-toggle-icon.expanded {
    transform: rotate(180deg);
}

.filter-grid {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: grid;
    gap: 1rem;
    transition: all 0.3s ease;
}

.form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--white);
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
    outline: none;
}

/* 水电站列表区域 */
.stations-section {
    flex: 1;
    padding: 1.5rem;
}

.stations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.stations-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stations-count {
    background: var(--gray-100);
    color: var(--primary-purple);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
}

/* 水电站列表 */
.stations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding: 0.5rem 0;
    /* 优化滚动条性能 */
    scroll-behavior: smooth;
    /* Firefox滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.station-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    flex-shrink: 0;
}

.station-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: var(--transition);
}

.station-item.operational::before {
    background: var(--success-color);
}

.station-item.construction::before {
    background: var(--warning-color);
}

.station-item.planned::before {
    background: var(--info-color);
}

.station-item:hover {
    border-color: var(--primary-purple);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.station-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.station-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    margin: 0;
    flex: 1;
    margin-right: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.station-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.station-status.operational {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.station-status.construction {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.station-status.planned {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.station-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.station-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    min-height: 20px;
}

.station-detail-icon {
    color: var(--primary-purple);
    font-size: 0.75rem;
    width: 12px;
    flex-shrink: 0;
}

.station-company {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
    min-height: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.station-company span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-company span:hover {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

/* 地图图例 */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 100;
}

.legend-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-color.operational {
    background: var(--success-color);
}

.legend-color.construction {
    background: var(--warning-color);
}

.legend-color.planned {
    background: var(--info-color);
}

/* 缩放级别指示器 */
#zoom-level-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 100;
}

/* 按钮样式 */
.btn {
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow);
}

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid var(--gray-200);
}

.modal-header {
    background: var(--white);
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
    background: var(--white);
}

.modal-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

.btn-close {
    filter: none;
    opacity: 0.6;
}

.btn-close:hover {
    opacity: 1;
}

/* 卡片样式 */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    background: var(--gradient-light);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

/* 表格样式 */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.table th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background: var(--gray-50);
}

/* 表单样式 */
.form-control {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
    outline: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
        max-height: 50vh;
    }
    
    .map-section {
        height: 50vh;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .filter-section,
    .stations-section {
        padding: 1rem;
    }
    
    .station-details {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.spinner-border {
    color: var(--primary-purple);
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* 徽章样式 */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
}

.badge.bg-secondary {
    background: var(--gray-400) !important;
}

/* 自定义滚动条 */
.stations-list::-webkit-scrollbar {
    width: 6px;
}

.stations-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.stations-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.stations-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stats-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-purple);
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* 过渡动画 */
.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 无数据状态 */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.empty-state-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state-subtext {
    font-size: 0.875rem;
}

/* 站点列表项高亮效果 */
.station-item.highlighted {
    border-color: var(--primary-purple);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.15);
    background: linear-gradient(135deg, rgba(123, 104, 238, 0.02) 0%, rgba(79, 70, 229, 0.02) 100%);
    transform: translateY(-1px);
}

/* 列表项悬浮效果改进 */
.station-item:hover .station-name {
    color: var(--primary-purple);
}

.station-item:hover .station-detail-icon {
    color: var(--accent-blue);
}

/* 模态框改进 */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.6);
}

/* 视图选择器 */
.view-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
}

.view-selector-title {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-options {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.view-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    position: relative;
}

.view-option:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.view-option.active {
    background: var(--gradient-primary);
    color: white;
}

.view-option.active:hover {
    background: var(--gradient-primary);
}

.view-premium-icon {
    color: #FFD700;
    font-size: 0.75rem;
    margin-left: auto;
}

.view-option.active .view-premium-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* 会员模态框样式 */
.premium-preview {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gradient-light);
    padding: 1rem;
}

.preview-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
}

.preview-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.premium-info {
    background: var(--gradient-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: 100%;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.membership-card {
    background: var(--white);
    border: 2px solid var(--primary-purple);
    border-radius: var(--radius-md);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.membership-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.membership-name {
    font-weight: 600;
    color: var(--gray-800);
}

.membership-price {
    font-weight: 700;
    color: var(--primary-purple);
    font-size: 1.125rem;
}

.membership-features {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.membership-features small {
    color: var(--gray-500);
}

/* 自定义徽章样式 */
.bg-purple {
    background-color: #7B68EE !important;
    color: white !important;
}

.bg-purple:hover {
    background-color: #6356E8 !important;
}

/* 确保所有徽章都有正确的文字颜色 */
.badge.bg-light {
    background-color: #6c757d !important;
    color: white !important;
}

.badge.bg-secondary {
    color: white !important;
} 