/* 从index.html中移植的内联样式 */

/* 基本CLS修复样式 */
.hero { min-height: 160px; }
main { min-height: 100vh; }
.server-list { min-height: 200px; }
.server-card { height: 240px; }
#loading { pointer-events: none; }
.server-logo { width: 52px; height: 52px; }

@media (max-width: 768px) {
    .hero { min-height: 120px; }
    .server-card { min-height: 200px; }
}

/* 移动设备分类菜单样式 */
.mobile-category-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 100;
    cursor: pointer;
}

.mobile-category-toggle i {
    font-size: 20px;
}

@media (max-width: 992px) {
    .mobile-category-toggle {
        display: flex;
    }
}

/* 服务器卡片进入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.server-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    padding: 0;
    border-radius: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow, 0 3px 10px rgba(0,0,0,0.08));
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 240px;
    margin: 0;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-inner {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
    position: relative;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow, 0 6px 15px rgba(0,0,0,0.1));
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.hot-badge {
    background-color: #ff5252;
    color: white;
}

.verified-badge {
    background-color: #4caf50;
    color: white;
}

.new-badge {
    background-color: #2196f3;
    color: white;
}

.logo-container {
    width: 52px;
    height: 52px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-color);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.server-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.card-header {
    display: flex;
    align-items: center;
}

.app-info {
    flex: 1;
}

.app-info h3 {
    margin: 0 0 5px 0;
    font-size: 17px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    transition: color 0.3s ease;
}

.author {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.card-body {
    margin: 12px 0 0 0;
    height: 80px;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.card-body p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: color 0.3s ease;
}

.card-footer {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    bottom: 10px;
    left: 20px;
    right: 20px;
    width: auto;
    background-color: var(--card-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.metric i {
    margin-right: 5px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.github-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--tag-bg);
    transition: all 0.2s;
}

.github-link i {
    margin-right: 0;
}

.github-link:hover {
    background-color: var(--tool-item-bg);
    color: var(--primary-color-dark);
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    padding: 1rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.page-btn {
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #e0e0e0;
}

.page-btn.active {
    background: #007bff;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.load-more-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: background-color 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.load-more-btn:hover {
    background: #0056b3;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
    display: inline-block;
    min-width: 120px;
    text-align: center;
    font-weight: 500;
}

.no-results {
    width: 100%;
    padding: 40px 0;
    text-align: center;
    color: #777;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

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

/* 媒体查询 */
@media (min-width: 1600px) {
    .server-list {
        max-width: 1500px;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

@media (max-width: 1400px) {
    .server-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 1200px) {
    .server-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .server-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 650px) {
    .server-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }
    
    .server-card {
        min-width: 0;
    }
}

@media (max-width: 992px) {
    .categories-sidebar-floating {
        display: none;
    }
    
    .mobile-category-toggle {
        display: none;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: #007bff;
        color: white;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        z-index: 100;
        cursor: pointer;
    }
    
    .mobile-category-toggle i {
        font-size: 20px;
    }
    
    .mobile-categories {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 200;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-categories.active {
        display: flex;
    }
    
    .mobile-categories-card {
        width: 80%;
        max-width: 320px;
        max-height: 80vh;
        background-color: white;
        border-radius: 12px;
        padding: 20px;
        overflow-y: auto;
    }
    
    .mobile-categories .category-item {
        padding: 15px 15px;
        margin-bottom: 5px;
        border-radius: 8px;
        border-left: none;
        border-left: 3px solid transparent;
    }
    
    .mobile-categories .category-item.active {
        background-color: #f0f4ff;
        border-left: 3px solid #4e73f8;
    }
}

@media (max-width: 768px) {
    main {
        padding: 20px 0;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .search-wrapper {
        padding: 0 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .server-list {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    .server-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
        min-width: 0;
    }
    
    .categories-sidebar-floating {
        display: none;
    }
    
    header {
        padding: 12px 20px;
    }
    
    header .logo span {
        display: inline;
        font-size: 1.2rem;
    }
    
    .content-container {
        margin: 0 auto;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        min-height: auto;
    }
    
    .servers-content {
        width: 100%;
        padding: 0 0 40px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #mobile-category-list .category-item {
        margin-bottom: 8px;
        border-radius: 6px;
        padding: 12px 15px;
    }
    
    .server-card {
        height: auto;
        min-height: 220px;
    }
    
    .card-inner {
        padding: 15px;
    }
    
    .card-body {
        margin-top: 10px;
        height: auto;
        min-height: 80px;
    }
    
    .card-footer {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        width: 100%;
        padding-top: 12px;
        margin-top: 10px;
    }
    
    .sort-buttons-container {
        margin: 10px 0 15px 0;
        justify-content: center;
        width: 100%;
    }
    
    /* 确保所有按钮都显示 */
    .sort-button {
        display: inline-block;
    }
}

.mobile-category-toggle {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 100;
    cursor: pointer;
}

.mobile-category-toggle i {
    font-size: 20px;
}

.mobile-categories {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.mobile-categories.active {
    display: flex;
}

.mobile-categories-card {
    width: 80%;
    max-width: 320px;
    max-height: 80vh;
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}

.hero {
    text-align: center;
    margin: 20px 0 30px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.hero h1 span {
    font-weight: 700;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0;
}

.counter {
    display: none;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: #666;
}

.server-counter-badge {
    text-align: center;
    margin: 20px auto 25px;
}

.counter-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--tag-bg);
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease;
}

.counter-text {
    color: var(--text-secondary);
    font-size: 16px;
    transition: color 0.3s ease;
}

.counter-number {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary-color);
    margin: 0 5px;
    transition: color 0.3s ease;
}

.search-wrapper {
    max-width: 700px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    padding: 5px 5px 5px 15px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 3px 20px rgba(0,0,0,0.12);
}

.search-icon {
    display: flex;
    margin-right: 10px;
}

.ai-badge-left {
    background: var(--primary-gradient, linear-gradient(135deg, #007bff, #6610f2));
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

#search-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--text-color);
}

#search-btn {
    background-color: var(--primary-btn-bg);
    color: var(--primary-btn-text);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 5px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: background-color 0.2s;
}

#search-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background-color: var(--primary-btn-text);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'%3E%3C/path%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

#search-btn:hover {
    background-color: var(--primary-btn-hover-bg);
}

#search-btn::before,
#search-btn i {
    display: none !important;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    position: relative;
    min-height: calc(100vh - 300px);
    transition: opacity 0.2s ease;
}

.categories-sidebar-floating {
    position: sticky;
    top: 100px;
    width: 220px;
    height: calc(100vh - 120px);
    margin-right: 30px;
    flex-shrink: 0;
}

.categories-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 0;
    box-shadow: var(--card-shadow, 0 4px 15px rgba(0,0,0,0.08));
    height: 100%;
    overflow-y: auto;
    max-height: 90vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.categories-card h2 {
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 20px 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
    letter-spacing: 0.5px;
}

.categories-card h2:before {
    content: '\f03a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    font-size: 16px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100% - 60px);
    width: 100%;
}

.category-item {
    padding: 12px 17px 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    display: flex;
    align-items: center;
    border-radius: 0;
    border-left: 3px solid transparent;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    height: 46px;
    box-sizing: border-box;
    margin: 0;
    position: relative;
}

.category-item:hover {
    background-color: var(--tool-item-bg);
}

.category-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: transparent;
}

.category-item.active:before {
    background-color: #4e73f8;
}

.category-item.active {
    background-color: var(--tag-bg);
    color: var(--primary-color);
    border-left: 3px solid transparent;
}

.category-item i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    display: inline-block;
    transition: color 0.3s ease;
}

.category-item.active i {
    color: var(--primary-color);
}

.category-header {
    display: flex;
    align-items: center;
    width: 100%;
    white-space: nowrap;
}

.category-header span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.category-item.active .category-header span {
    font-weight: 500;
}

.category-count {
    display: none;
}

.servers-content {
    flex: 1;
    min-width: 0;
    padding-top: 0;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.server-count-container {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.current-category-indicator,
.server-count-text {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    margin: 10px 0;
}

.loading-more .loading-spinner {
    width: 24px;
    height: 24px;
    margin-bottom: 10px;
}

.loading-more span {
    color: #666;
    font-size: 14px;
}

.no-more-data {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    color: #888;
    font-size: 14px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.priority-category {
    font-weight: 500 !important;
}

.priority-category i {
    color: var(--category-color, #4e73f8) !important;
}

.priority-category .category-header span {
    color: #4e73f8;
}

.category-item[data-category="all"] i {
    color: #6366f1 !important;
}

.category-item[data-category="featured"] i {
    color: #f59e0b !important;
}

.category-item[data-category="popular"] i {
    color: #ef4444 !important;
}

.category-item[data-category="latest"] i {
    color: #10b981 !important;
}

.category-item[data-category="development"] i,
.category-item[data-category="dev"] i {
    color: #8854d0 !important;
}

.category-item[data-category="social"] i {
    color: #20bf6b !important;
}

.category-item[data-category="data"] i {
    color: #3867d6 !important;
}

.category-item[data-category="search"] i {
    color: #eb3b5a !important;
}

.category-item[data-category="finance"] i {
    color: #2d98da !important;
}

.category-item[data-category="creation"] i,
.category-item[data-category="creative"] i {
    color: #fa8231 !important;
}

.category-item[data-category="enterprise"] i {
    color: #4b6584 !important;
}

.category-item[data-category="production"] i {
    color: #4b7bec !important;
}

.category-item[data-category="e-commerce"] i,
.category-item[data-category="ecommerce"] i {
    color: #fc5c65 !important;
}

.category-item[data-category="official"] i {
    color: #45aaf2 !important;
}

.category-item[data-category="托管"] i,
.category-item[data-category="hosted"] i {
    font-size: 1.2em !important;
    vertical-align: middle;
    color: #ef4444 !important;
}

.category-list .category-item:not(.priority-category) {
    margin-top: 5px;
}

.priority-category + .category-item:not(.priority-category) {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.priority-category + .category-item:not(.priority-category)::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.1), transparent);
    z-index: 1;
}

.priority-category + .category-item:not(.priority-category)::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 10px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #6366f1;
    box-shadow: 0 0 3px rgba(99, 102, 241, 0.5);
    z-index: 2;
}

/* 覆盖“客户端”入口的分隔线与样式：不需要上方横线 */
.category-item.clients-entry {
    margin-top: 5px;
    padding-top: 12px;
    border-top: none !important;
}
.priority-category + .category-item.clients-entry {
    margin-top: 5px;
    padding-top: 12px;
    border-top: none !important;
}
.priority-category + .category-item.clients-entry::before,
.priority-category + .category-item.clients-entry::after {
    display: none !important;
}

/* 客户端图标使用统一纯色（与其他分类保持一致风格） */
.category-item.clients-entry i {
    color: #6366f1 !important;
}

/* “客户端”文字颜色固定为与“直连/精选”相同的蓝色 */
.category-item.clients-entry .category-header span {
    color: #2563eb !important; /* 与其他高亮分类一致 */
}

.theme-toggle {
    position: relative;
    display: inline-block;
}

.theme-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    width: 150px;
    display: none;
    overflow: hidden;
}

.theme-toggle:hover .theme-dropdown {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
}

.theme-option:hover {
    background-color: var(--tag-bg);
}

.theme-option i {
    width: 18px;
    text-align: center;
}

/* 重新添加 server-list 的基础网格布局规则 */
.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 响应式列布局，更弹性的最小宽度 */
    gap: 24px; /* 保持 inline-styles 中的间距 */
    margin: 0 auto;
    padding: 10px;
    max-width: 1400px;
    width: 100%;
    min-height: 300px; 
    position: relative; 
    transition: opacity 0.3s ease-in-out; /* <-- 添加透明度过渡效果 */
}

/* 添加列表加载时的隐藏样式 */
.server-list.list-loading {
    opacity: 0;
    min-height: 300px; /* 保持最小高度防止页面跳动 */
}

/* 内容区域头部样式 */
.content-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    width: 100%;
}

/* 排序按钮区域样式 */
.sort-buttons-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 20px 0;
    position: relative;
    width: auto;
    max-width: none;
}

.sort-buttons {
    display: flex;
    background-color: #f0f2f5;
    border-radius: 30px;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: auto;
    justify-content: space-between;
}

body.dark-mode .sort-buttons {
    background-color: #2d3748 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.sort-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 10px;
}

.sort-button {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    font-weight: 500;
}

body.dark-mode .sort-button {
    color: #a0aec0 !important;
}

.sort-button.active {
    background-color: white;
    color: #4a6cf7;
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.15);
}

body.dark-mode .sort-button.active {
    background-color: #1a202c !important;
    color: #63b3ed !important;
    box-shadow: 0 2px 6px rgba(99, 179, 237, 0.2) !important;
}

.sort-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.3);
    color: #4a6cf7;
}

body.dark-mode .sort-button:hover:not(.active) {
    background-color: rgba(26, 32, 44, 0.5) !important;
    color: #63b3ed !important;
}

@media (max-width: 768px) {
    .sort-buttons-container {
        margin: 10px 0 15px 0;
        justify-content: center;
        width: 100%;
    }
    
    /* 确保所有按钮都显示 */
    .sort-button {
        display: inline-block;
    }
}

/* 右上角排序标签页样式 */
.top-tab-buttons {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 90;
    display: flex;
    background-color: #f0f2f5;
    border-radius: 30px;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .top-tab-buttons {
    background-color: #2d3748 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.top-tab-button {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    font-weight: 500;
}

.top-tab-button.active {
    background-color: white;
    color: #4a6cf7;
    box-shadow: 0 2px 6px rgba(74, 108, 247, 0.15);
}

body.dark-mode .top-tab-button {
    color: #9ca3af !important;
}

body.dark-mode .top-tab-button.active {
    background-color: #374151 !important;
    color: #60a5fa !important;
    box-shadow: 0 2px 6px rgba(96, 165, 250, 0.3) !important;
}

.top-tab-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.3);
    color: #4a6cf7;
}

body.dark-mode .top-tab-button:hover:not(.active) {
    background-color: #374151 !important;
    color: #60a5fa !important;
}

@media (max-width: 768px) {
    .top-tab-buttons {
        top: 70px;
        right: 15px;
    }
}
