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

body {
    font-family: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimHei, Arial, Helvetica, sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.5;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    border-bottom: 1px solid #000000;
    background-color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 60px; /* 固定导航栏高度 */
}

/* 导航菜单容器 - 固定在横线上方 */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    position: absolute;
    top: 60px; /* 导航栏高度 */
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    padding: 8px 20px;
    width: 100%;
    justify-content: center;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.logo {
    width: 57px;
    height: 57px;
    border-radius: 50%;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-item {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: #4CAF50;
}

/* 页面标题栏样式 */
.page-header {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    border-bottom: 1px solid #000000;
    background-color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-button {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    cursor: pointer;
}

.page-title {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
}

/* 内容区域样式 */
.content {
    padding: 30px;
    min-height: 80vh;
    margin-top: 120px; /* 导航栏高度 + 导航菜单高度 + 横线间距 */
}

/* 下拉菜单样式 */
.dropdown-container {
    margin: 30px 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 15px 0;
    margin: 30px 5px;
}

.dropdown {
    padding: 12px 24px;
    border-radius: 9px 0 0 0;
    background-color: #d9d9d9;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 5px;
}

.dropdown-arrow {
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 5px;
}

/* 下拉选项样式 */
.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    min-width: 180px;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
}

.dropdown-option {
    padding: 15px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 2px 0;
    line-height: 1.4;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option:active {
    background-color: #e0e0e0;
}

/* 增加下拉菜单的触发区域，避免过于灵敏 */
.dropdown-container:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 30px;
}

.dropdown-options:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 20px;
}

/* 导航栏下拉菜单样式 */
.nav-dropdown {
    position: relative;
    display: inline-block;
    padding: 15px 0;
    margin: 0 5px;
}

.nav-dropdown .nav-item {
    position: relative;
    z-index: 1001;
    padding: 10px 5px;
    cursor: pointer;
}

/* 为移动设备添加下拉箭头指示 */
@media (max-width: 768px) {
    .nav-dropdown .nav-item:after {
        content: ' ▼';
        font-size: 10px;
        margin-left: 5px;
    }
}

.nav-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    min-width: 180px;
    z-index: 1000;
    display: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* 桌面端悬停效果 */
@media (min-width: 769px) {
    .nav-dropdown:hover .nav-dropdown-options {
        display: block;
    }
}

/* 移动设备下拉菜单样式优化 */
@media (max-width: 768px) {
    .nav-dropdown-options {
        position: static;
        width: 100%;
        min-width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        padding: 10px 0;
        margin-top: 5px;
    }
    
    .nav-dropdown-option {
        padding: 12px 20px;
        text-align: center;
    }
}

.nav-dropdown-option {
    padding: 15px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 2px 0;
    line-height: 1.4;
}

.nav-dropdown-option:hover {
    background-color: #f5f5f5;
}

.nav-dropdown-option:active {
    background-color: #e0e0e0;
}

/* 增加下拉菜单的触发区域，避免过于灵敏 */
.nav-dropdown:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 30px;
}

.nav-dropdown-options:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .navbar-right {
        gap: 20px;
    }
    
    .nav-item {
        font-size: 14px;
    }
    
    .logo {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        height: auto; /* 移除固定高度，适应内容 */
        min-height: 60px;
    }
    
    .navbar-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .page-header {
        padding: 8px 15px;
    }
    
    .content {
        padding: 15px;
        margin-top: 140px; /* 调整内容区域边距，适应动态导航栏高度 */
    }
    
    .page-title {
        font-size: 16px;
    }
}

/* 通用按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 9px;
    background-color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.btn:hover {
    background-color: #f5f5f5;
    border-color: #4CAF50;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f9f9f9;
}

/* 图表容器样式 */
.chart-container {
    width: 100%;
    min-height: 400px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
}

/* 搜索框样式 */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

/* 图片画廊样式 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f9f9f9;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* 弹出窗口样式 */
.image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.popup-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto 20px;
}

.popup-caption {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

/* 加载指示器样式 */
.loading-indicator {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 图片加载动画 */
.gallery-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 图片占位符样式 */
.gallery-item img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.gallery-item.loaded img {
    animation: none;
    background: transparent;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .gallery-item img {
        height: 120px;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .popup-content {
        max-width: 95%;
        max-height: 85%;
        padding: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}