﻿/* AI Standards Page Styles */

/* Navigation - Fixed positioning to keep navbar visible while scrolling */
.main-nav {
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-80);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start; /* 改为 flex-start,手动控制布局 */
    align-items: center;
    height: 70px;
    gap: 24px;
}

.logo-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    height: 70px;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
}

.logo-subtitle {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.nav-menu {
    display: flex;
    gap: var(--space-8);
    align-items: center;
    flex: 1; /* 占据剩余空间 */
    justify-content: center; /* 导航菜单居中 */
}

/* 语言选择器样式已在 language-selector.css 中定义,无需额外设置 */
/* 将语言选择器推到右侧,靠近 Sign In 按钮 */
.language-selector {
    margin-left: auto;
    margin-right: 12px; /* 与 Sign In 按钮保持 12px 间距 */
}

.nav-link {
    color: var(--color-gray-600);
    text-decoration: none;
    font-weight: var(--font-medium);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.nav-link:hover {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.1);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Page Header */
.page-header {
    background: #ededfc;
    color: #333B5F;
    padding: var(--space-20) 0 var(--space-16) 0;
    text-align: center;
    margin-top: 70px;
}

.page-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
    color: #333B5F;
}

.page-subtitle {
    font-size: var(--text-xl);
    margin-bottom: var(--space-8);
    color: #333B5F;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.stat-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: #333B5F;
}

.stat-label {
    font-size: var(--text-sm);
    color: #333B5F;
}

/* Main Content */
.main-content {
    background: #FBFBFF;
    padding-top: 70px; /* Add padding to prevent content from being hidden behind fixed navbar */
}

.container {
    max-width: 90%;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

/* 大屏幕优化：在超大屏幕上也限制最大宽度，避免过宽 */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

section {
    padding: var(--space-16) 0;
}

section h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-8);
    color: var(--color-gray-900);
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.section-description {
    font-size: var(--text-lg);
    color: var(--color-gray-600);
    margin-bottom: var(--space-8);
}

/* Search Section */
.search-section {
    background: var(--color-white);
}

.search-header {
    margin-bottom: var(--space-6);
}

.search-bar {
    margin-bottom: var(--space-6);
}

#search-input {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: all var(--transition-base);
}

#search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-search,
.btn-clear,
.btn-download {
    padding: var(--space-4) var(--space-8);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-search:hover,
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-clear {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.btn-clear:hover {
    background: var(--color-gray-300);
}

/* ========================================
   Search and Filters - Pill-Based 标签式筛选系统
   ======================================== */

.search-and-filters-top {
    margin: 24px 0;
}

/* 搜索框 */
.search-bar-modern {
    position: relative;
    margin-bottom: 20px;
}

.search-bar-modern .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-bar-modern input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #1f2937;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-bar-modern input:hover {
    border-color: #d1d5db;
}

.search-bar-modern input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Pill筛选器容器 */
.filter-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Pill筛选器 */
.filter-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    z-index: 1;
}

.filter-pill:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.filter-pill.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.filter-pill.open {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    z-index: 10001;
}

.pill-label {
    font-weight: 500;
    color: #6b7280;
}

.filter-pill.active .pill-label {
    color: rgba(255, 255, 255, 0.9);
}

.pill-value {
    font-weight: 600;
    color: #1f2937;
}

.filter-pill.active .pill-value {
    color: white;
}

.pill-arrow {
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.filter-pill.active .pill-arrow {
    color: rgba(255, 255, 255, 0.8);
}

.filter-pill.open .pill-arrow {
    transform: rotate(180deg);
}

/* Pill Dropdown Menu */
.pill-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    max-width: 320px;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    padding: 8px;
    pointer-events: none;
}

.dropdown-select { display: none; } /* 隐藏原生select，使用自定义列表 */

/* 确保下拉列表不受激活态白色文字影响 */
.filter-pill .pill-dropdown { color: #374151; }
.filter-pill.active .pill-dropdown { color: #374151; }
.pill-dropdown .dropdown-option { display: flex; align-items: center; gap: 8px; color: #4b5563; }
.pill-dropdown .dropdown-option.selected { color: #2563eb; font-weight: 600; }

.filter-pill.open .pill-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 10000;
}

.pill-option {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #4b5563;
    transition: all 0.2s ease;
}

.pill-option:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.pill-option.selected {
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
    font-weight: 600;
}

/* Clear All Button */
.btn-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-filters:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-clear-filters svg {
    color: currentColor;
}

/* ========================================
   Search and Filters Top Layout
   ======================================== */

.search-and-filters-top {
    margin: 24px 0;
}

/* 搜索框 */
.search-bar-modern {
    position: relative;
    margin-bottom: 20px;
}

.search-bar-modern input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-bar-modern input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}


/* Pill筛选器容器 */
.filter-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* 单个筛选pill */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 14px;
    z-index: 1;
}

.filter-pill:hover {
    border-color: #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.filter-pill.open {
    z-index: 10001;
}

.filter-pill.active {
    background: #2563EB;
    color: white;
    border-color: transparent;
}

.filter-pill.active .pill-label,
.filter-pill.active .pill-value {
    color: white;
}

.pill-label {
    color: #666;
    font-size: 13px;
}

.pill-value {
    color: #333;
    font-weight: 500;
}

.pill-dropdown-icon {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.filter-pill.open .pill-dropdown-icon {
    transform: rotate(180deg);
}

/* Pill下拉菜单 */
.pill-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 200px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.filter-pill.open .pill-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 10000;
}

.dropdown-option {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.dropdown-option:hover {
    background: #f5f5f5;
}

.dropdown-option input {
    margin-right: 8px;
}

.dropdown-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 清除所有筛选按钮 */
.clear-all-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
}

.clear-all-filters:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* 已应用筛选条件显示 */
.active-filters-inline {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.active-filters-inline .filter-count {
    color: #666;
    font-size: 14px;
}

/* 已应用筛选条件 */
.active-filters {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.filter-count {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.btn-clear-all {
    font-size: 12px;
    color: #2563EB;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-clear-all:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

/* 筛选标签 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563EB;
    color: white;
    font-size: 12px;
    padding: 4px 8px 4px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.filter-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-tag-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 侧边栏搜索框 */
.sidebar-search {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 筛选组 */
.filter-group {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

/* 筛选选项（复选框） */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: #f9fafb;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.filter-option label {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

/* 下拉筛选器 */
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #d1d5db;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 右侧数据内容区 */
.database-content {
    min-width: 0;  /* 防止内容溢出 */
}

/* Filters (旧版，保留用于兼容) */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--color-gray-50);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-8);
}

/* Force select dropdowns to always open downward */
.filters select {
    position: relative;
}

/* Custom dropdown behavior for select elements */
.filters select:focus {
    /* Ensure enough space below for dropdown */
    margin-bottom: 0 !important;
}

/* Override browser default dropdown positioning */
.filters select option {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter-group label {
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
}

.filter-group select {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background: var(--color-white);
    font-size: var(--text-sm);
}

/* Results */
.results-container {
    margin-top: var(--space-8);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-gray-200);
}

#results-count {
    font-weight: var(--font-semibold);
    color: var(--color-gray-700);
}

.results-actions select {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background: var(--color-white);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 300px;
}

.standard-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
    cursor: pointer;
}

.standard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.standard-name {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}

.standard-title {
    font-size: var(--text-base);
    color: var(--color-gray-700);
    margin-bottom: var(--space-3);
}

.standard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.standard-tag {
    padding: var(--space-1) var(--space-3);
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
    margin-bottom: var(--space-8);
}

.pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #000;
    text-decoration: none;
}

.page-btn:hover:not(.active):not(:disabled) {
    background: #f5f5f5;
    border-color: #999;
}

.page-btn.active {
    background: #0066cc;
    color: #000;
    border-color: #0066cc;
    font-weight: 600;
    cursor: default;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
    color: #000;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #999;
    font-weight: 500;
    user-select: none;
}

/* Analytics Section */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-16);
}

.chart-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
}

.chart-card h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-4);
    color: var(--color-gray-900);
}

.chart-card canvas {
    max-height: 300px;
}

/* Architecture Diagram */
.architecture-section {
    margin-top: var(--space-16);
}

.architecture-section h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-8);
    text-align: center;
}

.architecture-diagram {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.layer {
    background: var(--color-white);
    border-left: 4px solid #667eea;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.layer:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.layer h4 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
    color: var(--color-gray-900);
}

.layer p {
    color: var(--color-gray-600);
}

.layer[data-layer="L1"] { border-left-color: #667eea; }
.layer[data-layer="L2"] { border-left-color: #764ba2; }
.layer[data-layer="L3"] { border-left-color: #f093fb; }
.layer[data-layer="L4"] { border-left-color: #4facfe; }
.layer[data-layer="L5"] { border-left-color: #43e97b; }
.layer[data-layer="L6"] { border-left-color: #fa709a; }
.layer[data-layer="L7"] { border-left-color: #feca57; }

/* Database Section - Table Styles */
.data-table-container {
    width: 100%;
    overflow-x: auto; /* 允许横向滚动 */
    margin-bottom: var(--space-6);
}

.data-table {
    width: 100%;
    min-width: 1100px; /* 设置表格宽度，越小表格中的字体越会显现出来 */
    border-collapse: collapse;
    background: var(--color-white);
}

.data-table thead {
    background: var(--color-gray-50);
    border-bottom: 2px solid var(--color-gray-200);
}

.data-table thead th {
    padding: var(--space-4);
    text-align: center !important; /* 表头居中对齐,使用 !important 确保优先级 */
    font-weight: var(--font-semibold);
    color: var(--color-gray-700);
    font-size: var(--text-sm);
    white-space: nowrap; /* 防止表头换行 */
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-gray-100);
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    text-align: center; /* 单元格居中对齐 */
}

/* Title列特殊样式 - 允许2行显示后截断并显示省略号 */
.data-table td:nth-child(2) {
    max-width: 240px;
    vertical-align: middle;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
    text-align: center; /* 居中对齐（按您的要求） */
    overflow: visible; /* 由内部包装元素控制裁剪，避免半截 */
}

/* 内部包装用于实现多行省略，避免对 td 的 display 产生副作用 */
.data-table td:nth-child(2) .title-wrap {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为2行 */
    line-clamp: 2; /* 标准属性，向后兼容 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal; /* 允许换行 */
    line-height: 1.45; /* 略增行高，避免下缘裁切 */
}

.data-table tbody tr:hover {
    background: var(--color-gray-50);
}

/* View 按钮样式 */
.data-table .btn-view {
    padding: 6px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap; /* 防止按钮文字换行 */
    transition: background 0.2s;
}

.data-table .btn-view:hover {
    background: #1557b0;
}

/* 状态徽章样式 */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-inactive {
    background: #fff3e0;
    color: #e65100;
}

/* 搜索高亮样式 */
mark {
    background-color: #ffd700;
    padding: 0;
    font-weight: 600;
    color: inherit;
}
/* 与 <mark> 一致的搜索高亮（有些地方使用 span.search-highlight） */
.search-highlight {
    background-color: #ffd700;
    padding: 0;
    font-weight: 600;
    color: inherit;
}

/* Glossary Section */
.glossary-search {
    margin-bottom: var(--space-8);
}

.glossary-search input {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
}

/* 加载占位符脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
}

/* 骨架加载样式 */
.skeleton-row {
    opacity: 0.7;
}

.skeleton-cell {
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.glossary-list {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* 动态最小高度，确保加载时不跳动 */
    min-height: 850px;
    /* 防止结果较少时网格子项被拉伸至填满容器高度 */
    align-items: start;
    align-content: start;
}

.term-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    /* 统一卡片高度与布局 */
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.term-name {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    margin-bottom: var(--space-2);
    /* 单行省略，避免名称过长撑高卡片 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.term-definition {
    color: var(--color-gray-700);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-2);
    /* 限制显示2行，保持卡片一致高度 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性，向后兼容 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.term-source {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    font-style: italic;
    /* 将来源固定在卡片底部，进一步统一高度 */
    margin-top: auto;
}

/* Download Section */
.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.download-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.download-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.download-card h3 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
    color: var(--color-gray-900);
}

.download-card p {
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
}

/* Footer */
.page-footer {
    background: var(--color-gray-900);
    color: var(--color-gray-300);
    padding: var(--space-8) 0;
    text-align: center;
}

.page-footer p {
    margin: var(--space-2) 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-max);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-6);
    font-size: var(--text-3xl);
    cursor: pointer;
    color: var(--color-gray-500);
}

.modal-close:hover {
    color: var(--color-gray-900);
}

.modal-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-gray-200);
}

.modal-header h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
    margin: 0;
    padding-right: var(--space-12);
}

.modal-body {
    line-height: var(--leading-relaxed);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr; /* 左侧名称 / 右侧字段 */
    column-gap: var(--space-8);       /* 增加左右间距 */
    align-items: start;
}

.standard-name-large {
    font-size: calc(var(--text-2xl) + 6px); /* 再放大约2px，使其更醒目 */
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
    margin: 0;
}

.details-right {
    padding-left: var(--space-4); /* 再增加一些与左侧的间距 */
}

.detail-row {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: var(--font-semibold);
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    display: block;
}

.detail-value {
    color: var(--color-gray-900);
    word-wrap: break-word;
}

.detail-value a {
    color: var(--color-primary);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-details-grid {
        grid-template-columns: 1fr;
    }
    .details-right {
        padding-left: 0;
        margin-top: var(--space-4);
    }
    .nav-menu {
        gap: var(--space-4);
    }

    .nav-link {
        padding: var(--space-2);
        font-size: var(--text-sm);
    }

    .page-title {
        font-size: var(--text-3xl);
    }

    .header-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        flex-direction: column;
    }

    .database-layout {
        grid-template-columns: 1fr;  /* 单列布局 */
        gap: 20px;
    }

    .filter-sidebar {
        position: relative;
        top: 0;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .download-options {
        grid-template-columns: 1fr;
    }
}

/* Sign In Button - Cursor Style (参考 openml.org) */
.btn-login {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    margin-left: auto; /* 将登录按钮推到最右侧 */
}

.btn-login:hover {
    background-color: #f5f5f5;
}

.btn-login:active {
    transform: scale(0.98);
}

/* 用户信息区域 */
.user-info {
    display: none;
    align-items: center;
    gap: 12px;
    margin-left: auto; /* 将用户信息推到最右侧 */
}

.user-info.active {
    display: flex;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* 用户菜单弹窗 */
.user-menu-popup {
    position: fixed;
    top: 60px; /* 导航栏高度下方一点，让头像与弹窗有视觉关联 */
    right: 20px; /* 默认值，与容器的padding一致 */
    width: 240px; /* 减小宽度 */
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.user-menu-header {
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.user-menu-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    padding: 4px 0;
    transition: background-color 0.2s ease;
}

.user-menu-name:hover {
    background-color: #f5f5f5;
}

.user-menu-name:hover .copy-btn {
    display: inline-flex !important;
}

.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease;
}

.copy-btn:hover {
    color: #1a1a1a;
}

.user-menu-email-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    transition: background-color 0.2s ease;
}

.user-menu-email-row:hover {
    background-color: #f5f5f5;
}

.user-menu-email-row:hover .copy-btn {
    display: inline-flex !important;
}

.user-menu-email {
    font-size: 13px;
    color: #666;
}

.user-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-menu-item:hover {
    background-color: #f5f5f5;
}

.user-menu-item svg {
    color: #666;
}

/* 搜索高亮样式 */
.search-highlight {
    background-color: #ffeb3b; /* 黄色背景 */
    color: #000; /* 黑色文字 */
    font-weight: 600; /* 加粗 */
    padding: 2px 0;
    border-radius: 2px;
}


/* Advanced Options Accordion */
#advanced-options-header { cursor: pointer; user-select: none; }
.accordion-arrow { transition: transform 0.3s ease; }
.advanced-options-accordion .accordion-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.advanced-options-accordion.expanded .accordion-arrow { transform: rotate(180deg); }

/* Download Icon Button Styles */
.download-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 12px;
    padding: 0;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.download-icon-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.download-icon-btn:hover svg {
    stroke: #667eea;
}

.download-icon-btn:active {
    transform: scale(0.95);
}

.download-icon-btn svg {
    transition: stroke 0.3s ease;
}

/* Help Icon Button Styles */
.help-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 12px;
    padding: 0;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    vertical-align: middle;
    text-decoration: none;
}

.help-icon-btn:hover {
    background: #333;
    border-color: #333;
    transform: scale(1.05);
}

.help-icon-btn:hover svg {
    stroke: white;
}

.help-icon-btn:active {
    transform: scale(0.95);
}

.help-icon-btn svg {
    stroke: #333;
    transition: stroke 0.3s ease;
}
