/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    padding-top: 76px;
}

/* ===== 导航栏 - 完全统一风格 ===== */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 滚动时增强阴影 */
.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;  /* 上下 16px，左右 24px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* Logo 区域 - 统一高度 */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    font-size: 24px;      /* 统一字体大小 */
    letter-spacing: 0.02em;
    color: #00838f;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.85;
}

.nav-logo img {
    height: 48px;         /* 统一图片高度 */
    width: auto;
}

/* 导航菜单 - 统一间距和字体 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;            /* 统一菜单间距 */
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;      /* 统一字体大小 */
    padding: 8px 0;
    transition: all 0.2s ease;
    position: relative;
}

/* 悬停效果 */
.nav-menu a:hover {
    color: #00838f;
}

/* 激活/当前页面样式 */
.nav-menu a.active {
    color: #00838f;
    border-bottom: 2px solid #00838f;
}

/* 如果旧导航栏使用背景高亮方式，保留兼容 */
.nav-menu a.active-bg {
    background: rgba(0, 131, 143, 0.1);
    color: #006064;
    border-radius: 5px;
    padding: 8px 15px;
}

/* 为 body 添加顶部内边距，防止内容被固定导航栏遮挡 */
body {
    padding-top: 76px;    /* 导航栏高度约 76px */
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-logo span {
        font-size: 18px;
    }
    
    .nav-logo img {
        height: 36px;
    }
    
    .nav-menu {
        gap: 16px;
    }
    
    .nav-menu a {
        font-size: 14px;
    }
    
    body {
        padding-top: 60px;
    }
}
/* ===== 下拉菜单样式 - 与导航栏风格统一 ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle .fa-chevron-down {
    transition: transform 0.25s ease;
    font-size: 0.7em;
    margin-left: 6px;
}

.dropdown:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* 下拉菜单面板 - 使用与导航栏一致的配色 */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    transform-origin: top center;
    background: rgba(233, 250, 253, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 8px 0;
    min-width: 190px;
    box-shadow: 0 8px 25px rgba(0, 131, 143, 0.15);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(0, 131, 143, 0.15);
    z-index: 1000;
    pointer-events: none;
}

/* 下拉菜单三角箭头 - 使用导航栏配色 */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid rgba(194, 239, 246, 0.98);
    filter: drop-shadow(0 -1px 2px rgba(0, 131, 143, 0.05));
}

/* 悬停时展开 */
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dropdown-menu li {
    height: auto;
    display: block;
    padding: 2px 8px;
}

/* 下拉菜单选项 - 与导航栏链接风格一致 */
.dropdown-menu a {
    color: #00838f;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    gap: 12px;
    white-space: nowrap;
    justify-content: flex-start;
    background: transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* 下拉菜单悬停效果 - 与导航栏一致 */
.dropdown-menu a:hover {
    background: rgba(0, 131, 143, 0.08);
    color: #006064;
}

/* 下拉菜单图标颜色 - 与导航栏保持一致 */
.dropdown-menu a i {
    width: 20px;
    text-align: center;
    color: #00838f;
    opacity: 0.8;
}

.dropdown-menu a:hover i {
    opacity: 1;
}

/* 移动端响应式 - 下拉保持可用 */
@media (max-width: 768px) {
    .navbar {
        height: auto;
        min-height: 80px;
    }

    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        gap: 5px;
        margin-top: 5px;
        width: 100%;
    }

    .nav-menu li {
        height: auto;
    }

    .dropdown-menu {
        left: 0;
        transform: translateX(0) translateY(-5px);
        top: 100%;
        min-width: 160px;
    }

    .dropdown:hover .dropdown-menu {
        transform: translateX(0) translateY(0);
    }
}

/* ===== 页面主体布局 ===== */
.page-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 30px;
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 76px);
}

/* ===== 左侧筛选面板 ===== */
.filter-panel {
    width: 320px;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filter-panel::-webkit-scrollbar {
    width: 4px;
}

.filter-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.filter-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.filter-panel h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-panel h2 i {
    color: #00838f;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.filter-group label i {
    margin-right: 6px;
    color: #00838f;
    width: 16px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.2s ease;
    color: #1e293b;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #00838f;
    box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.1);
    background: white;
}

.filter-group select:hover,
.filter-group input:hover {
    border-color: #94a3b8;
}

.filter-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-group .range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group .range-inputs input {
    width: calc(50% - 4px);
    padding: 8px 10px;
}

.filter-group .range-inputs span {
    color: #94a3b8;
    font-weight: 500;
}

.filter-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 14px 0;
}

/* 搜索按钮 */
.search-btn {
    width: 100%;
    padding: 12px;
    background: #00838f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-btn:hover {
    background: #006064;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 131, 143, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.reset-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* 隐藏工具筛选 */
.tool-filter-hidden {
    display: none !important;
}

.tool-filter-visible {
    display: block !important;
}

/* ===== 右侧内容区域 ===== */
.content-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    min-height: 500px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.content-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.content-header .result-count {
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 14px;
    border-radius: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* ===== 表格样式 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
}

thead th i {
    margin-right: 4px;
}

thead th.sortable {
    cursor: pointer;
    user-select: none;
}

thead th.sortable:hover {
    color: #1e293b;
}

thead th.sortable::after {
    content: '↕';
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.3;
}

thead th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

thead th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 12px 16px;
    color: #1e293b;
    vertical-align: middle;
}

/* ===== 下载按钮 ===== */
.download-btn {
    padding: 8px 16px;
    background: #00838f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    background: #006064;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 131, 143, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn i {
    font-size: 14px;
}

/* ===== 状态标签 ===== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-up {
    background: #dcfce7;
    color: #166534;
}

.badge-down {
    background: #fef2f2;
    color: #991b1b;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.badge-tool {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-event {
    background: #e0f2fe;
    color: #0369a1;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-buttons button {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    min-width: 36px;
}

.pagination-buttons button:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pagination-buttons button.active {
    background: #00838f;
    border-color: #00838f;
    color: white;
}

.pagination-buttons button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== 加载状态 ===== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #00838f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .page-container {
        flex-direction: column;
        padding: 16px;
    }

    .filter-panel {
        width: 100%;
        min-width: unset;
        position: relative;
        top: 0;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-logo span {
        font-size: 18px;
    }
    
    .nav-menu {
        gap: 16px;
    }
    
    .nav-menu a {
        font-size: 14px;
    }
    
    body {
        padding-top: 60px;
    }

    .page-container {
        padding: 12px;
    }

    .filter-panel {
        padding: 16px;
    }

    .content-panel {
        padding: 16px;
    }

    table {
        font-size: 12px;
    }

    thead th,
    tbody td {
        padding: 8px 10px;
    }

    .pagination {
        flex-direction: column;
        align-items: center;
    }
}