/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", system-ui, sans-serif;
}

html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

:root {
    --main-color: #165DFF;
    --light-color: #E8F3FF;
    --text-color: #333;
    --gray-color: #666;
    --border-color: #eee;
    --white: #fff;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 必应壁纸背景层 */
.bing-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: background-image 1.5s ease;
}
.bing-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: rgba(247, 248, 250, 0.85);
    backdrop-filter: blur(2px);
}

body {
    color: var(--text-color);
    line-height: 1.6;
    background: transparent;
}

.container {
    width: 94%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 吸顶容器 */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 头部样式 */
.site-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}
.logo-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.site-logo {
    font-size: 20px;
    color: var(--main-color);
    font-weight: 700;
    white-space: nowrap;
}
.site-logo i {
    margin-right: 6px;
}
.util-links {
    display: flex;
    gap: 8px;
    font-size: 12px;
    padding-left: 4px;
}
.util-links a {
    color: #999;
    text-decoration: none;
    border-bottom: 1px dashed #ccc;
    transition: all 0.2s;
}
.util-links a:hover {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
}

/* 搜索引擎搜索框 */
.engine-search {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 50px;
    height: 42px;
    flex: 1;
    max-width: 480px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}
.engine-search:focus-within {
    border-color: var(--main-color);
}
.engine-select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    padding: 0 8px 0 14px;
    color: var(--text-color);
    cursor: pointer;
    height: 100%;
    border-radius: 50px 0 0 50px;
}
.engine-input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    height: 100%;
    font-size: 14px;
    padding: 0 8px;
}
.engine-btn {
    border: none;
    background: transparent;
    color: var(--main-color);
    cursor: pointer;
    font-size: 15px;
    padding: 0 14px 0 8px;
    height: 100%;
    border-radius: 0 50px 50px 0;
}
.engine-btn:hover { color: #0d47d0; }

/* 导航站内搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 50px;
    padding: 0 12px;
    height: 42px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}
.search-box:focus-within { border-color: var(--main-color); }
#searchInput {
    border: none;
    outline: none;
    background: transparent;
    width: 200px;
    height: 100%;
    font-size: 14px;
    padding: 0 6px;
}
.search-btn {
    border: none;
    background: transparent;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 15px;
}

/* 筛选栏 */
.filter-bar {
    background: rgba(247, 248, 250, 0.9);
    backdrop-filter: blur(4px);
    padding: 10px 0 4px;
}

/* 统一筛选按钮尺寸 */
.cate-wrap { padding-bottom: 6px; }
.cate-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cate-item {
    padding: 4px 14px;
    background: var(--white);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    color: var(--gray-color);
}
.cate-item.active, .cate-item:hover {
    background: var(--main-color);
    color: var(--white);
    border-color: var(--main-color);
}

/* 省份筛选栏 */
.region-wrap { padding-bottom: 2px; }
.region-list { display: flex; flex-wrap: wrap; gap: 6px; }
.province-item {
    padding: 4px 14px;
    background: var(--white);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    color: var(--gray-color);
}
.province-item.active, .province-item:hover {
    background: #FF6B35;
    color: var(--white);
    border-color: #FF6B35;
}

/* 结果计数徽标 */
.result-badge {
    font-size: 11px;
    color: #fff;
    background: var(--main-color);
    padding: 2px 8px;
    border-radius: 10px;
    margin: 0 4px;
    min-width: 28px;
    text-align: center;
    font-weight: 600;
}

/* 网址卡片布局 */
.main-content {
    padding-bottom: 80px;
    min-height: 60vh;
}
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.site-card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(4px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(22,93,255,0.15);
    background: rgba(255,255,255,0.95);
}
.site-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}
.site-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--main-color);
}
.site-tag {
    font-size: 12px;
    color: var(--gray-color);
    background: var(--light-color);
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}
.site-province {
    font-size: 11px;
    color: #FF6B35;
    background: #FFF3ED;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
}
.loading-tip {
    text-align: center;
    font-size: 16px;
    color: var(--gray-color);
    padding: 60px 0;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 40px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 200;
    color: var(--main-color);
    font-size: 18px;
    border: 1px solid var(--border-color);
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
    box-shadow: 0 4px 16px rgba(22,93,255,0.3);
}

/* 页脚 */
.site-footer {
    background: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    color: var(--gray-color);
    border-top: 1px solid var(--border-color);
}
.site-footer p { margin: 6px 0; }

/* 移动端适配 */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 10px;
    }
    .site-logo { font-size: 18px; }
    .engine-search { order: 3; max-width: 100%; flex: 100%; }
    .search-box { order: 2; }
    #searchInput { width: 140px; }
    .filter-bar { padding: 8px 0 2px; }
    /* 筛选行横滑 */
    .cate-list, .region-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .cate-list::-webkit-scrollbar, .region-list::-webkit-scrollbar { display: none; }
    .cate-item, .province-item { flex-shrink: 0; }
    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .site-card { padding: 15px; }
    .back-to-top { right: 16px; bottom: 24px; width: 40px; height: 40px; }
}
