:root {
    --bg-color: #0c0c0c;
    /* Very dark gray, almost black */
    --text-color: #f0f0f0;
    /* Light gray for text - Made brighter */
    --primary-accent: #00f0ff;
    /* Bright cyan/tech blue */
    --secondary-accent: #ff00ff;
    /* Magenta for some highlights, or can be toned down */
    --border-color: #333333;
    /* Dark gray for borders */
    --table-header-bg: #1a1a1a;
    /* Slightly lighter dark for table headers */
    --hover-bg-color: #222222;
    /* Hover background for interactive elements */
    --card-bg-color: #101010;
    /* Background for card-like elements */

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Roboto Mono', "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

    --warning-color-bg: rgba(255, 220, 0, 0.08);
    /* For 'new' badge background */
    --warning-color-text: #ffd700;
    /* For 'new' badge text */
    --ratio-color-bg: rgba(0, 240, 255, 0.08);
    /* For 'high ratio' badge background */
    --ratio-color-text: var(--primary-accent);
    /* For 'high ratio' badge text */
    --fees-color-bg: rgba(255, 0, 255, 0.08);
    /* For 'high fees' badge background */
    --fees-color-text: var(--secondary-accent);
}

body {
    font-family: var(--font-sans);
    padding-top: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 90%;
    /* Slightly narrower for a more focused look */
    margin: 0 auto;
}

/* New header styles */
.main-header {
    display: flex;
    align-items: center;
    /* Vertically align logo, title, and spacer */
    /* padding: 10px 0; /* Optional: if more vertical space is needed around header items */
    margin-bottom: 25px;
    /* Space below the entire header */
    width: 100%;
    /* Ensure it takes full width of container */
}

#siteLogo {
    width: 40px;
    /* Fixed width for the logo */
    height: 40px;
    /* Fixed height for the logo */
    object-fit: contain;
    /* Ensures logo aspect ratio is maintained within fixed dimensions */
    flex-shrink: 0;
    /* Prevent logo from shrinking */
    /* margin-bottom: 0; Removed as it's now a flex item */
}

.page-title {
    /* This is h1 */
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-accent);
    font-size: 2.2rem;
    letter-spacing: 1px;
    line-height: 1;
    /* Tighten line height for better vertical centering */
    text-align: center;
    /* Center text within its own flex item space */
    flex-grow: 1;
    /* Allow title to take up available space */
    margin: 0 10px;
    /* Add some small horizontal margin to prevent touching logo/spacer if title is long */
}

#headerSpacer {
    width: 40px;
    /* Must match #siteLogo width */
    flex-shrink: 0;
    /* Prevent spacer from shrinking */
}

/* Old h1 styles are now in .page-title, no separate h1 rule needed unless for global h1 reset */

.table {
    border-collapse: collapse;
    /* Removes gaps between cells */
    width: 100%;
}

.table th,
.table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    /* More padding in table cells */
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-color);
}

.table thead th {
    background-color: var(--table-header-bg);
    color: var(--primary-accent);
    font-family: var(--font-mono);
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Styles for Sortable Headers */
.table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
    /* Make space for the indicator */
}

.table thead th.sortable:hover {
    background-color: var(--hover-bg-color);
}

.table thead th .sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
}

.table thead th.sortable:hover .sort-indicator {
    opacity: 0.7;
}

/* Default state: show both up and down arrows faintly */
.table thead th.sortable .sort-indicator::before,
.table thead th.sortable .sort-indicator::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    position: absolute;
    left: -5px;
}

.table thead th.sortable .sort-indicator::before {
    border-bottom: 5px solid var(--text-color);
    top: -7px;
}

.table thead th.sortable .sort-indicator::after {
    border-top: 5px solid var(--text-color);
    top: 3px;
}

/* Active sort states */
.table thead th.sort-asc .sort-indicator,
.table thead th.sort-desc .sort-indicator {
    opacity: 1;
}

.table thead th.sort-asc .sort-indicator::before {
    border-bottom-color: var(--primary-accent);
}

.table thead th.sort-asc .sort-indicator::after {
    display: none;
    /* Hide down arrow */
}

.table thead th.sort-desc .sort-indicator::after {
    border-top-color: var(--primary-accent);
}

.table thead th.sort-desc .sort-indicator::before {
    display: none;
    /* Hide up arrow */
}

.table tbody tr:hover {
    background-color: var(--hover-bg-color);
}

/* Explicitly style striped rows for dark mode if using .table-striped */
.table-striped>tbody>tr:nth-of-type(odd)>* {
    /* Targets <td> or <th> in tbody */
    color: var(--text-color);
    background-color: var(--hover-bg-color);
    /* Directly set cell background for odd rows */
}

.table-striped>tbody>tr:nth-of-type(even)>* {
    /* Targets <td> or <th> in tbody */
    color: var(--text-color);
    background-color: var(--bg-color);
    /* Directly set cell background for even rows */
}

.loading-spinner {
    display: none;
    width: 1.5rem;
    /* Smaller spinner */
    height: 1.5rem;
    vertical-align: middle;
    border-color: var(--primary-accent);
    border-right-color: transparent;
}

.status-bar {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg-color);
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    /* No box-shadow for a flatter look */
}

.filter-card {
    margin-bottom: 25px;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #aaa;
    /* Dimmer text for filter criteria */
}

.filter-card strong {
    color: var(--text-color);
    font-weight: 500;
}

.filter-card span {
    color: var(--primary-accent);
    font-weight: bold;
}

.table-responsive {
    /* max-height: 75vh; */
    /* Removed to prevent double scrollbars */
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    /* Ensure background matches body */
    /* No box-shadow */
}

.btn-primary,
.btn-refresh

/* Apply to specific button if needed, or general .btn */
    {
    background-color: var(--primary-accent) !important;
    border-color: var(--primary-accent) !important;
    color: var(--bg-color) !important;
    /* Dark text for contrast on bright button */
    font-family: var(--font-mono);
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    /* Slightly more padding */
    border-radius: 0.25rem;
    /* Standard border radius */
    transition: all 0.2s ease-in-out;
    /* Smooth transitions */
    box-shadow: none;
    /* Remove default Bootstrap shadow */
}

.btn-primary:hover,
.btn-refresh:hover {
    background-color: #00c0cc;
    /* Slightly darker cyan on hover */
    border-color: #00c0cc;
    color: var(--bg-color);
    box-shadow: 0 0 8px var(--primary-accent);
    /* Subtle glow effect */
}

.btn-primary:focus,
.btn-primary:active,
.btn-refresh:focus,
.btn-refresh:active {
    background-color: #00a0b0 !important;
    /* Even darker cyan for active/focus state */
    border-color: #00a0b0 !important;
    color: var(--bg-color) !important;
    box-shadow: 0 0 5px #007bff, 0 0 10px var(--primary-accent) !important;
    /* Remove Bootstrap's default focus shadow and use a custom one */
    outline: none !important;
    /* Remove default browser outline */
}

/* Ensure spinner inside button has good contrast */
.btn-primary .loading-spinner,
.btn-refresh .loading-spinner {
    border-color: var(--bg-color);
    /* Spinner color to contrast with button background */
    border-right-color: transparent;
}

.form-check-label {
    user-select: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.form-switch .form-check-input {
    background-color: #444;
    border-color: var(--border-color);
    border-radius: 0;
    /* Potentially sharp switch if desired */
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
}

a.link-custom {
    text-decoration: none;
    color: var(--primary-accent);
    transition: color 0.2s, text-decoration 0.2s;
}

a.link-custom:hover {
    text-decoration: underline;
    color: #00ffff;
    /* Slightly brighter cyan on hover */
}

.token-mint {
    font-family: var(--font-mono);
    font-size: 0.8em;
    word-break: break-all;
    color: var(--text-color);
    /* Changed from #999 to use the main text color */
}

.tvl-value,
.fee-value,
.ratio-value {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Remove row-specific background highlights for a cleaner table, rely on badges */
tr.high-ratio td,
tr.new-pool td {
    background-color: transparent !important;
}

tr.high-tvl td {
    font-weight: bold;
    /* Optionally make high TVL text bold */
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    /* Further reduced font size */
    padding: 0.15em 0.4em;
    /* Further reduced padding */
    font-weight: 500;
    border-radius: 0;
    /* Sharp badges */
    vertical-align: super;
    /* Changed to super for superscript effect */
    margin-left: 3px;
    /* Reduced margin */
    text-transform: uppercase;
    border: 1px solid transparent;
    display: inline-block;
    /* Helps with alignment and wrapping */
}

.badge-high-ratio {
    background-color: var(--ratio-color-bg);
    color: var(--ratio-color-text);
    border-color: var(--ratio-color-text);
}

.badge-new {
    background-color: var(--warning-color-bg);
    color: var(--warning-color-text);
    border-color: var(--warning-color-text);
}

.badge-high-fees {
    background-color: var(--fees-color-bg);
    color: var(--fees-color-text);
    border-color: var(--fees-color-text);
}

#lastUpdated {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-color) !important;
}

/* Style for the links column to keep them on one line */
.links-cell {
    white-space: nowrap;
}

/* Footer Styles */
.site-footer {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #777;
    /* Dimmer text for footer */
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
    /* Space above the footer */
    border-top: 1px solid var(--border-color);
}

.site-footer p {
    margin-bottom: 0;
}

.site-footer a.link-custom {
    color: #999;
    /* Slightly brighter link color for footer */
    text-decoration: none;
}

.site-footer a.link-custom:hover {
    color: var(--primary-accent);
    text-decoration: none;
}

/* Add a subtle retro scanline effect (optional) */
/*
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        transparent,
        transparent 1px,
        rgba(0, 240, 255, 0.02) 1px,
        rgba(0, 240, 255, 0.02) 2px
    );
    z-index: 9999;
}
*/

/* 筛选参数设置样式 */
#filterSettings .card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#filterSettings .card-body {
    padding: 1.5rem;
}

#filterSettings .form-label {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#filterSettings .form-control {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

#filterSettings .form-control:focus {
    background-color: var(--bg-color);
    border-color: var(--primary-accent);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.25);
}

#filterSettings .form-control::placeholder {
    color: #777;
}

.btn-outline-primary {
    color: var(--primary-accent);
    border-color: var(--primary-accent);
    background-color: transparent;
    font-family: var(--font-mono);
    font-weight: 500;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.btn-outline-primary:hover {
    color: var(--bg-color);
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
}

.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: var(--bg-color) !important;
    background-color: var(--primary-accent) !important;
    border-color: var(--primary-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.25) !important;
}

/* 筛选条件区域内的Configure Filters按钮 */
#filterCriteria .btn-sm.btn-outline-primary {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
}

/* 筛选参数设置面板内的按钮样式 */
#filterSettings .btn-primary,
#filterSettings .btn-outline-primary {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

#currentCriteria {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 0.5rem;
}

#currentCriteria span {
    color: var(--primary-accent);
    font-weight: bold;
}

.global-metrics-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    color: #aaa;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
}

.global-metrics-card .metrics-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 32px;
    margin-bottom: 2px;
}

.global-metrics-card .metric-number {
    color: var(--primary-accent);
    font-weight: bold;
    font-family: inherit;
}

/* Footer Styles */
.site-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #6c757d;
}

.site-footer p {
    margin-bottom: 0.5rem;
}

/* Custom link style for footer and other areas */
.link-custom {
    color: #0d6efd;
    text-decoration: none;
}

.link-custom:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-bar>div:last-child {
        margin-top: 0.5rem;
        align-self: flex-start;
    }

    #filterCriteria {
        font-size: 0.8rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

/* 新增：风险评分单元格样式 */
.risk-score-cell {
    text-align: center;
    vertical-align: middle;
    font-weight: 500;
}

/* FAQ Section Styles */
.faq-section {
    width: 100%;
    padding: 20px;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    /* 移除圆角和阴影，保持扁平化设计 */
}

.faq-section h2.text-center {
    color: var(--primary-accent);
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.faq-section .accordion-item {
    background-color: transparent;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    /* 移除圆角，保持扁平化 */
}

.faq-section .accordion-item:last-of-type {
    margin-bottom: 0;
}

.faq-section .accordion-button {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.9rem;
    background-color: var(--table-header-bg);
    color: var(--text-color);
    border: none;
    /* 移除圆角 */
    padding: 15px 20px;
    transition: all 0.2s ease-in-out;
}

.faq-section .accordion-button:hover {
    background-color: var(--hover-bg-color);
    color: var(--primary-accent);
}

.faq-section .accordion-button:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.25);
}

/* 箭头样式调整 */
.faq-section .accordion-button::after {
    background-image: none;
    content: '▼';
    color: var(--text-color);
    transition: transform 0.2s ease-in-out;
    font-size: 0.8rem;
    margin-left: auto;
}

.faq-section .accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
    color: var(--primary-accent);
}

.faq-section .accordion-button:not(.collapsed) {
    color: var(--primary-accent);
    background-color: var(--hover-bg-color);
    /* 移除默认阴影 */
}

.faq-section .accordion-collapse {
    border-top: 1px solid var(--border-color);
}

.faq-section .accordion-body {
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 20px;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-family: var(--font-sans);
}

.faq-section .accordion-body strong {
    color: var(--primary-accent);
    font-weight: 600;
}