:root {
    --bg: #0b0f1c;
    --bg2: #121830;
    --card: rgba(20, 28, 48, .65);
    --glass: rgba(255, 255, 255, .08);
    --text: #fff;
    --text2: #b0c0da;
    --accent: linear-gradient(135deg, #6a8eff, #9f6eff);
    --radius: 28px;
    --radius-sm: 16px;
    --shadow: 0 25px 40px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, var(--bg) 0%, var(--bg2) 100%);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -30%;
    left: -10%;
    width: 70%;
    height: 80%;
    background: radial-gradient(circle, rgba(90, 140, 255, .15), transparent 70%);
}

body::after {
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 70%;
    background: radial-gradient(circle, rgba(159, 110, 255, .12), transparent 70%);
}

.site-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================================
 * 头部
 * ============================================================ */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    margin-bottom: 3rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo,
.custom-logo {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 10px 20px -5px rgba(106, 142, 255, .4);
    letter-spacing: -.5px;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.site-title a {
    background: linear-gradient(120deg, #fff, #b8c7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.site-description {
    font-size: .9rem;
    color: var(--text2);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: .5rem;
    flex-wrap: wrap;
}

.main-navigation a {
    padding: .7rem 1.3rem;
    color: var(--text2);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    border-radius: 40px;
    transition: .25s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

/* ============================================================
 * Hero
 * ============================================================ */
.hero-section {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 3rem;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #cfdcff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text2);
    font-weight: 300;
    margin-bottom: 2rem;
}

/* ============================================================
 * 搜索
 * ============================================================ */
.search-box {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 60px;
    border: 1px solid var(--glass);
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: .25s;
}

.search-box input:focus {
    border-color: rgba(106, 142, 255, .6);
    background: rgba(255, 255, 255, .08);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 22, 40, .95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass);
    padding: .5rem;
    display: none;
    z-index: 50;
    max-height: 360px;
    overflow: auto;
}

.search-results.show {
    display: block;
}

.search-results a {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: .7rem 1rem;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
}

.search-results a:hover {
    background: rgba(255, 255, 255, .06);
}

/* ============================================================
 * 分类锚点
 * ============================================================ */
.cat-anchors {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
}

.cat-anchors a {
    padding: .5rem 1rem;
    border-radius: 40px;
    background: rgba(255, 255, 255, .04);
    color: var(--text2);
    text-decoration: none;
    font-size: .9rem;
    border: 1px solid rgba(255, 255, 255, .06);
    transition: .25s;
}

.cat-anchors a:hover {
    color: #fff;
    background: rgba(106, 142, 255, .15);
    border-color: rgba(106, 142, 255, .4);
}

.cat-anchors span {
    opacity: .6;
    margin-left: 6px;
}

/* ============================================================
 * 卡片容器
 * ============================================================ */
.glass-card {
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title span {
    display: inline-block;
    width: 6px;
    height: 28px;
    background: var(--accent);
    border-radius: 20px;
}

.section-link {
    color: var(--text2);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    padding: .4rem .8rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, .05);
    transition: .25s;
}

.section-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

/* ============================================================
 * 网址网格
 * ============================================================ */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.site-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.1rem 1.2rem;
    background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .04);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: .25s;
    position: relative;
    overflow: hidden;
}

.site-card:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(106, 142, 255, .3);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -10px rgba(0, 0, 0, .5);
}

.site-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    overflow: hidden;
}

.site-card:hover .site-icon {
    background: rgba(106, 142, 255, .2);
    border-color: rgba(106, 142, 255, .5);
}

.site-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-desc {
    font-size: .8rem;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片图标里的图片（普通卡片） */
.site-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* ============================================================
 * 详情页
 * ============================================================ */
.site-detail .detail-head {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    margin-bottom: 2rem;
}

.site-detail .detail-title {
    font-size: 2.4rem;
    margin: 1rem 0;
}

/* 详情页大图标 */
.site-detail .site-icon.big {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 2rem;
    margin: 0 auto 1.2rem;      /* 水平居中 + 底部间距 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.site-detail .site-icon.big img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* 立即访问按钮 */
.btn-visit {
    display: inline-block;
    padding: .9rem 2rem;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 40px;
    font-weight: 600;
    box-shadow: 0 15px 30px -10px rgba(106, 142, 255, .6);
    transition: .25s;
}

.btn-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -10px rgba(106, 142, 255, .8);
}

/* 相关推荐里的卡片图标 */
.glass-card .site-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* ============================================================
 * 页脚
 * ============================================================ */
.site-footer {
    margin-top: 5rem;
    padding: 2rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, .04);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text2);
    font-size: .9rem;
}

.footer-links a {
    color: var(--text2);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: .25s;
}

.footer-links a:hover {
    color: #fff;
}

/* ============================================================
 * 分页
 * ============================================================ */
.pagination {
    text-align: center;
    margin-top: 2rem;
}

.pagination .page-numbers {
    display: inline-block;
    padding: .5rem 1rem;
    margin: 0 .2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    color: var(--text2);
    text-decoration: none;
}

.pagination .current {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 1.5rem 1rem;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .glass-card {
        padding: 1.8rem 1.2rem;
    }

    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-detail .detail-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }
}


.site-detail .detail-body a {
    display: inline-block;
    color: #fff;
    background: linear-gradient(135deg, #6a8eff, #9f6eff);
    padding: .2em .8em;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: .25s;
}

.site-detail .detail-body a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 15px -5px rgba(106, 142, 255, .6);
}

/* ============================================================
 * 详情页优化
 * ============================================================ */
.site-detail .detail-head {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    margin-bottom: 2rem;
}

.site-detail .detail-title {
    font-size: 2.4rem;
    margin: .8rem 0 .5rem;
    letter-spacing: -.02em;
}

.site-detail .detail-url {
    font-size: .95rem;
    color: var(--text2);
    margin-top: .3rem;
    word-break: break-all;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.site-detail .detail-cats {
    margin-top: .8rem;
    font-size: .9rem;
    color: var(--text2);
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.site-detail .detail-cats a {
    padding: .25rem .8rem;
    background: rgba(106, 142, 255, .12);
    border-radius: 20px;
    color: #8ab4ff;
    text-decoration: none;
    transition: .25s;
}

.site-detail .detail-cats a:hover {
    background: rgba(106, 142, 255, .3);
    color: #fff;
}

.site-detail .detail-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: .8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-copy {
    display: inline-block;
    padding: .9rem 1.6rem;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: .25s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, .12);
    transform: translateY(-2px);
}

.site-detail .detail-body {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text2);
    line-height: 1.8;
    font-size: 1.05rem;
}

.site-detail .detail-body a {
    color: #8ab4ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(138, 180, 255, .5);
    transition: .25s;
}

.site-detail .detail-body a:hover {
    color: #b8c7ff;
    border-bottom-style: solid;
}

.site-detail .detail-back {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.site-detail .detail-back a {
    color: var(--text2);
    text-decoration: none;
    font-size: .95rem;
    transition: .25s;
}

.site-detail .detail-back a:hover {
    color: #fff;
}

/* 详情页大图标 */
.site-detail .site-icon.big {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 2rem;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.site-detail .site-icon.big img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* 详情页移动端 */
@media (max-width: 768px) {
    .site-detail .detail-title {
        font-size: 1.8rem;
    }
    .site-detail .detail-body {
        font-size: 1rem;
    }
    .site-detail .detail-actions {
        flex-direction: column;
        align-items: center;
    }
    .btn-visit, .btn-copy {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

/* ============================================================
 * 风格切换按钮
 * ============================================================ */
.style-switcher {
    width: auto;
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: .25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    white-space: nowrap;
}

.style-switcher:hover {
    background: rgba(106, 142, 255, .2);
    transform: translateY(-1px);
}

.style-switcher span {
    font-weight: 500;
}

.style-switcher:active {
    transform: scale(.96);
    transition: transform .1s;
}

/* ============================================================
 * 风格切换弹窗
 * ============================================================ */
.style-switcher-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 22, 40, .98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, .8);
    display: none;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.style-switcher-panel.show {
    display: block;
}

.style-switcher-panel h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
}

.style-switcher-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.style-switcher-panel li button {
    width: 100%;
    padding: .9rem 1rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    color: #fff;
    font-size: .95rem;
    cursor: pointer;
    text-align: left;
    transition: .2s;
    font-family: inherit;
    min-height: 48px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.style-switcher-panel li button:hover {
    background: rgba(106, 142, 255, .2);
    border-color: rgba(106, 142, 255, .4);
}

.style-switcher-panel li button.active {
    background: linear-gradient(135deg, #6a8eff, #9f6eff);
    border-color: transparent;
}

.style-switcher-panel li button:active {
    transform: scale(.98);
}

.style-switcher-panel .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.style-switcher-panel .close-btn:active {
    background: rgba(255, 255, 255, .15);
}

/* ============================================================
 * 遮罩层
 * ============================================================ */
.style-switcher-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.style-switcher-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
 * 移动端适配
 * ============================================================ */
@media (max-width: 768px) {

    /* Header 布局：品牌 + 按钮 一行，菜单第二行 */
    .site-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand switch"
            "nav   nav";
        gap: 1rem;
        align-items: center;
    }

    .site-branding {
        grid-area: brand;
    }

    .main-navigation {
        grid-area: nav;
        width: 100%;
    }

    .style-switcher {
        grid-area: switch;
        justify-self: end;
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
    }

    /* 导航在移动端可横向滚动 */
    .main-navigation ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .main-navigation ul::-webkit-scrollbar {
        display: none;
    }

    .main-navigation li {
        flex-shrink: 0;
    }

    /* 面板从底部滑入 */
    .style-switcher-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(100%);
        border-radius: 24px 24px 0 0;
        padding: 1.5rem 1.2rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
        max-height: 70vh;
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        opacity: 1;
    }

    .style-switcher-panel.show {
        transform: translateY(0);
    }

    /* 顶部拖拽条 */
    .style-switcher-panel::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, .2);
        border-radius: 2px;
    }

    .style-switcher-panel h3 {
        font-size: 1.05rem;
        margin-bottom: 1.2rem;
        margin-top: .5rem;
    }

    .style-switcher-panel li button {
        padding: 1rem 1.1rem;
        font-size: 1rem;
        min-height: 52px;
        border-radius: 14px;
    }

    .style-switcher-panel .close-btn {
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* 超小屏 */
@media (max-width: 480px) {

    .style-switcher {
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .style-switcher span {
        display: none;
    }

    .style-switcher::after {
        content: '风格';
        font-size: 12px;
    }

    .style-switcher-panel {
        padding: 1.2rem 1rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
        max-height: 75vh;
    }

    .style-switcher-panel h3 {
        font-size: 1rem;
    }

    .style-switcher-panel li button {
        padding: .9rem 1rem;
        font-size: .95rem;
        min-height: 48px;
    }
}