:root {
    --page-bg: #f4f6f8;
    --container-bg: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent-color: #007aff;
    --accent-color-hover: #005ec4;
    --accent-color-shadow: rgba(0, 122, 255, .25);
    --border-color: #e2e8f0;
    --filter-bg: #fdfdfe;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --stock-in: #34c759;
    --stock-out: #ff3b30;
    --lowest-price-badge-bg: #e6f4ff;
    --lowest-price-badge-text: #005ec4;
    --animation-duration-fast: 0.15s;
    --animation-duration-normal: 0.3s;
    --animation-duration-slow: 0.5s;
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-out: ease-out;
    --disabled-bg: #c5c6c9;
    --disabled-opacity: 0.6;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    background-color: var(--page-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 新增：图标通用样式 */
.icon {
    display: inline-block;
    opacity: 0.85;
    font-size: 0.9em;
    /* 移除 margin-right，改用父元素的 gap */
}

/* 新增：主页眉样式 */
.site-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.site-title h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--text-primary);
}

.site-title .subtitle {
    margin: 5px 0 0;
    font-size: 1.1em;
    color: var(--text-secondary);
}

/* 新增：通用区域标题 */
.section-title {
    font-size: 1.6em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.container {
    max-width: 1500px;
    margin: 2px auto;
    background-color: var(--container-bg);
    padding: 0px 50px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Site Description */
.site-description {
    background-color: var(--filter-bg);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.95em;
    color: var(--text-secondary);
}

.site-description p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.site-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.site-description .disclaimer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--text-secondary);
}

.site-description .disclaimer strong {
    color: #c53030;
    font-weight: 600;
}

/* 促销横幅样式 */
.promotion-banner {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e6f7ff 0%, #d0f0fd 100%);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.promotion-banner::before {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.promotion-icon {
    font-size: 1.8em;
    margin-right: 12px;
    color: var(--accent-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite ease-in-out;
    z-index: 1;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.promotion-content {
    flex: 1;
    z-index: 1;
}

.promotion-content h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--accent-color-hover);
    font-size: 1em;
    font-weight: 600;
}

.promotion-content p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--accent-color-hover);
}

/* 增强：为链接添加动画下划线和外部链接图标 */
.promotion-content a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(var(--accent-color-hover), var(--accent-color-hover));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size var(--animation-duration-normal) var(--easing-standard), color var(--animation-duration-fast) ease;
}

.promotion-content a:hover {
    color: var(--accent-color-hover);
    background-size: 100% 1px;
}

/* 为外部链接添加图标 */
.promotion-content a[href^="http"]::after {
    content: ' ↗';
    font-size: 0.8em;
    display: inline-block;
    vertical-align: super;
    margin-left: 2px;
    transition: transform var(--animation-duration-fast) ease-out;
}

.promotion-content a[href^="http"]:hover::after {
    transform: translate(2px, -2px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 新增：响应式页眉 */
    .site-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .site-title h1 {
        font-size: 1.8em;
    }

    .site-title .subtitle {
        font-size: 1em;
    }

    .language-switcher {
        align-self: flex-end;
    }

    .promotion-banner {
        flex-direction: row;
        text-align: left;
        padding: 8px 12px;
    }
    
    .promotion-icon {
        font-size: 1.5em;
        margin-right: 8px;
    }
    
    .promotion-content h3 {
        font-size: 0.95em;
    }
    
    .promotion-content p {
        font-size: 0.85em;
    }
}

/* 页脚样式 */
.site-footer {
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

/*
  在页脚中，我们需要重置 .site-description 的盒模型样式。
  这个类在别处用作带边框和背景的卡片，但在页脚中我们只需要它的文本内容。
  因此，这里移除了它的内外边距、背景和边框，让它无缝融入页脚。
*/
.site-footer .site-description {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.site-footer .promotion-banner {
    margin: 0;
    background: linear-gradient(135deg, rgba(230, 247, 255, 0.7) 0%, rgba(208, 240, 253, 0.7) 100%);
}

@media (max-width: 768px) {
    .site-footer {
        padding: 20px 0;
        margin-top: 30px;
    }
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    padding: 30px;
    background-color: var(--filter-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

.filters>div,
.filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filters label,
.filters .filter-group>label {
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Styling for SELECT elements */
.filters select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-sizing: border-box;
    font-size: 1em;
    font-family: var(--font-sans);
    background-color: var(--container-bg);
    color: var(--text-primary);
    transition: border-color var(--animation-duration-normal) var(--easing-standard),
        box-shadow var(--animation-duration-normal) var(--easing-standard);
}

/* Specific Styling for the Title Keywords input using its ID */
#filterTitle {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-sizing: border-box;
    font-size: 1em;
    font-family: var(--font-sans);
    background-color: var(--container-bg);
    color: var(--text-primary);
    transition: border-color var(--animation-duration-normal) var(--easing-standard),
        box-shadow var(--animation-duration-normal) var(--easing-standard);
}

.filters select:focus,
#filterTitle:focus {
    /* Apply focus style to select and specifically to #filterTitle */
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 3px var(--accent-color-shadow);
}

/* Styles for Range Input Filters (RAM and Disk) */
.filter-range-group .range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-range-group .range-inputs input[type="number"] {
    width: calc(50% - 12px);
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-sizing: border-box;
    font-size: 1em;
    font-family: var(--font-sans);
    background-color: var(--container-bg);
    color: var(--text-primary);
    text-align: center;
    transition: border-color var(--animation-duration-normal) var(--easing-standard),
        box-shadow var(--animation-duration-normal) var(--easing-standard);
    -moz-appearance: textfield;
}

.filter-range-group .range-inputs input[type="number"]::-webkit-outer-spin-button,
.filter-range-group .range-inputs input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-range-group .range-inputs input[type="number"]:focus {
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 3px var(--accent-color-shadow);
}

.filter-range-group .range-inputs span {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 2px;
}

/* Summary & Sort Bar (unchanged) */
.summary-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
}

#resultsCount {
    font-weight: 600;
    font-size: 1.25em;
    color: var(--text-primary);
}

#sortOrderContainer label {
    margin-right: 12px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-secondary);
}

#sortOrder {
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-size: 1em;
    background-color: var(--container-bg);
    color: var(--text-primary);
}

/* Results Container (unchanged) */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 35px;
    position: relative;
    transition: opacity var(--animation-duration-normal) var(--easing-out);
}

.results-container.results-loading {
    opacity: 0.5;
}

/* Card Entrance Animation (unchanged) */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product Card (unchanged) */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 25px 30px;
    background-color: var(--container-bg);
    box-shadow: var(--card-shadow);
    transition: transform var(--animation-duration-normal) var(--easing-standard),
        box-shadow var(--animation-duration-normal) var(--easing-standard);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    animation: cardEntrance var(--animation-duration-slow) var(--easing-out) forwards;
    opacity: 0;
}

.product-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: var(--card-hover-shadow);
}

.product-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--accent-color);
    line-height: 1.3;
    transition: color var(--animation-duration-fast) ease;
}

.product-card:hover h3 {
    color: var(--accent-color-hover);
}

.product-card p {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.45;
}

.product-card .spec {
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 8px;
    transition: color var(--animation-duration-fast) ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.product-card:hover .spec {
    color: var(--accent-color);
    font-weight: 600;
}

.product-card .stock-in {
    color: var(--stock-in);
    font-weight: 600;
}

.product-card .stock-out {
    color: var(--stock-out);
    font-weight: 600;
}

.location-list {
    font-size: 0.9em;
    line-height: 1.4;
}

.more-locations {
    color: var(--accent-color);
    cursor: help;
    font-style: italic;
    font-size: 0.9em;
    transition: color var(--animation-duration-fast) ease;
}

.more-locations:hover {
    color: var(--accent-color-hover);
}

/* Billing Options & Badge (unchanged) */
.billing-options-list {
    list-style: none;
    padding: 0;
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.billing-options-list li {
    margin-bottom: 4px;
    padding-left: 0;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-options-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.billing-options-list .lowest-daily-price {
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes subtle-glow {
    0%, 100% {
        box-shadow: 0 0 4px rgba(0, 122, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 12px rgba(0, 122, 255, 0.5);
    }
}

.lowest-price-badge {
    background-color: var(--lowest-price-badge-bg);
    color: var(--lowest-price-badge-text);
    font-size: 0.8em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    margin-left: 8px;
    white-space: nowrap;
    animation: subtle-glow 2.5s infinite ease-in-out;
}

/* Pagination Controls (unchanged) */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.pagination-controls button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) ease,
        opacity var(--animation-duration-fast) ease,
        transform var(--animation-duration-normal) ease;
    font-weight: 500;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination-controls button:hover:not(:disabled) {
    background-color: var(--accent-color-hover);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.pagination-controls button:active:not(:disabled) {
    transform: translateY(0px) scale(0.96);
    transition-duration: var(--animation-duration-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-controls button:disabled {
    background-color: var(--disabled-bg);
    cursor: not-allowed;
    opacity: var(--disabled-opacity);
    box-shadow: none;
}

#currentPageInfo {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 18px;
}

/* Loading Overlay (unchanged) */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulseDots {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    font-size: 1.3em;
    transition: opacity var(--animation-duration-normal) var(--easing-out),
        visibility var(--animation-duration-normal) var(--easing-out);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-overlay .loader {
    border: 5px solid var(--page-bg);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p .dot {
    animation: pulseDots 1.4s infinite ease-in-out;
    display: inline-block;
}

.loading-overlay p .dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-overlay p .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-overlay p .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Language Switcher Dropdown (unchanged) */
/* 调整：语言切换器不再需要自己的背景和边框 */
.language-switcher {
    position: relative;
}

.dropdown-lang {
    position: relative;
    display: inline-block;
}

.dropdown-toggle-lang {
    background-color: var(--container-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color var(--animation-duration-fast), box-shadow var(--animation-duration-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dropdown-toggle-lang:hover,
.dropdown-toggle-lang.open {
    background-color: var(--page-bg);
    border-color: #d1d7de;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dropdown-toggle-lang .icon-globe {
    font-size: 1.1em;
}

.dropdown-toggle-lang .icon-arrow {
    font-size: 0.7em;
    transition: transform var(--animation-duration-normal) var(--easing-out);
}

.dropdown-toggle-lang.open .icon-arrow {
    transform: rotate(180deg);
}

.dropdown-menu-lang {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    margin-top: 8px;
    min-width: 160px;
    z-index: 1000;
    transform: translateY(-10px);
    transition: opacity var(--animation-duration-normal) var(--easing-out),
        transform var(--animation-duration-normal) var(--easing-out),
        visibility 0s linear var(--animation-duration-normal);
}

.dropdown-menu-lang.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.dropdown-menu-lang li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9em;
    white-space: nowrap;
    transition: background-color var(--animation-duration-fast);
}

.dropdown-menu-lang li a:hover {
    background-color: var(--page-bg);
}

.dropdown-menu-lang li a.active {
    font-weight: bold;
    background-color: var(--filter-bg);
    color: var(--accent-color);
}

/* 小巧思：为按钮添加水波纹点击效果 */
.pagination-controls button,
.modal-purchase-btn,
.modal-share-btn,
.test-latency-btn,
.back-to-locations-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Modal Styles (unchanged) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--animation-duration-normal) var(--easing-out),
        visibility var(--animation-duration-normal) var(--easing-out);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--container-bg, #ffffff);
    padding: 25px 30px;
    border-radius: var(--border-radius-md, 12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    color: var(--text-primary);
    transform: scale(0.95);
    opacity: 0;
    transition: transform var(--animation-duration-normal) var(--easing-out),
        opacity var(--animation-duration-normal) var(--easing-out);
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-overlay:not(.visible) .modal-content {
    opacity: 0;
    transform: scale(0.95);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-specs-text-section,
.modal-locations-section {
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.6;
}

.modal-specs-text-section .spec-label,
.modal-locations-section .spec-label {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.modal-specs-text {
    margin-bottom: 15px;
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 30vh;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-locations-section .locations-list {
    color: var(--text-secondary);
    padding-left: 0;
    list-style: none;
    margin-bottom: 15px;
}

/* 测速按钮样式 */
.test-latency-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 15px;
    font-size: 0.95em;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color var(--animation-duration-fast) ease,
        transform var(--animation-duration-normal) ease;
}

.test-latency-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.test-latency-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 返回按钮样式 */
.back-to-locations-btn {
    background-color: #f0f0f0;
    color: var(--text-secondary);
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color var(--animation-duration-fast) ease,
        transform var(--animation-duration-normal) ease;
    display: block;
}

.back-to-locations-btn:hover {
    background-color: #e4e4e4;
    transform: translateY(-1px);
}

.back-to-locations-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 位置容器样式 */
.locations-container {
    margin-bottom: 15px;
}

/* 延迟测试结果样式 */
.latency-results {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.latency-results h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-primary);
}

.latency-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.latency-table th, 
.latency-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.latency-table th {
    background-color: var(--filter-bg);
    font-weight: 600;
}

/* 延迟结果颜色指示 */
.good-latency {
    color: #2e7d32;
    font-weight: 600;
}

.medium-latency {
    color: #f57c00;
    font-weight: 600;
}

.poor-latency {
    color: #c62828;
    font-weight: 600;
}

.timeout {
    color: #616161;
    font-style: italic;
}

/* 最低延迟行样式 */
.lowest-latency-row {
    background-color: #e8f5e9;
    position: relative;
}

.lowest-latency-row td:first-child {
    position: relative;
}

.lowest-latency-row td:first-child::after {
    content: attr(data-recommended-text);
    position: absolute;
    top: 0;
    right: 5px;
    background-color: var(--lowest-price-badge-bg);
    color: var(--lowest-price-badge-text);
    font-size: 0.8em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
}

.modal-button-container {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-purchase-btn,
.modal-share-btn {
    flex-grow: 1;
    padding: 12px 15px;
    font-size: 1.05em;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) ease,
        opacity var(--animation-duration-fast) ease,
        transform var(--animation-duration-normal) ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal-purchase-btn:hover:not(:disabled),
.modal-share-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.modal-purchase-btn:active:not(:disabled),
.modal-share-btn:active:not(:disabled) {
    transform: translateY(0px) scale(0.97);
    transition-duration: var(--animation-duration-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modal-purchase-btn {
    color: white;
    background-color: var(--accent-color);
}

.modal-purchase-btn:hover:not(:disabled) {
    background-color: var(--accent-color-hover);
}

.modal-share-btn {
    color: var(--accent-color);
    background-color: var(--page-bg);
    border: 1px solid var(--border-color);
}

.modal-share-btn:hover:not(:disabled) {
    background-color: #e4e8ec;
    border-color: #d1d7de;
}

.modal-share-btn.copied-feedback {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
    opacity: 1 !important;
    transition: background-color var(--animation-duration-fast) ease-in, color var(--animation-duration-fast) ease-in;
}

.modal-share-btn:disabled:not(.copied-feedback) {
    opacity: var(--disabled-opacity);
    cursor: default;
    box-shadow: none;
    background-color: var(--page-bg);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--animation-duration-fast) ease, transform var(--animation-duration-fast) ease;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 1000px) {
    .container {
        padding: 25px;
        margin: 25px auto;
    }

    .site-description {
        padding: 15px;
        font-size: 0.9em;
    }

    .filters {
        gap: 20px;
        padding: 20px;
    }

    .summary-sort-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #resultsCount {
        font-size: 1.1em;
    }

    #sortOrderContainer label {
        margin-right: 8px;
    }

    .results-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }

    .product-card {
        padding: 20px;
    }

    .product-card h3 {
        font-size: 1.2em;
    }

    .product-card p {
        font-size: 0.9em;
    }

    .product-card .spec {
        margin-right: 5px;
    }

    .billing-options-list {
        font-size: 0.85em;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 15px;
        margin: 15px auto;
    }

    .site-description {
        padding: 10px;
        font-size: 0.85em;
    }

    .site-description p {
        margin-bottom: 8px;
    }

    .site-description .disclaimer {
        margin-top: 10px;
        padding-top: 10px;
    }

    .filters {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .filter-range-group .range-inputs {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .filter-range-group .range-inputs input[type="number"] {
        width: 100%;
    }

    .filter-range-group .range-inputs span {
        display: none;
    }

    .summary-sort-bar {
        padding: 10px 0;
    }

    .results-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-card {
        padding: 15px 20px;
    }

    .pagination-controls {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-controls button {
        margin: 0;
        width: 80%;
        max-width: 250px;
    }

    #currentPageInfo {
        margin: 5px 0;
    }

    .billing-options-list {
        font-size: 0.8em;
    }

    .modal-content {
        padding: 20px;
        max-height: 80vh;
    }

    .modal-content h2 {
        font-size: 1.3em;
    }

    .modal-button-container {
        flex-direction: column;
        gap: 10px;
    }
}

/* Utility class for screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
