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

html, body {
    height: 100%;
}

html {
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

body {
    background: #ffffff;
    color: #1a2332;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    max-width: 100vw;
}

/* body 是 flex column，子元素默认 min-width: auto 会按内容撑开，强制收缩 */
.nav, .hero, .footer, .section {
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ 顶部导航 ============ */
.nav {
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 0 rgba(15, 30, 60, 0.02);
    max-width: 100%;
    flex-shrink: 0;
}

.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: min(1140px, 100%);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    color: #1a2332;
}

.nav-brand:hover {
    color: #2f6fed;
}

.nav-logo {
    height: 36px;
    width: auto;
    display: block;
}

.nav-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #6b7a90;
}

.nav-info b {
    color: #2f6fed;
    font-weight: 600;
}

.nav-divider {
    width: 1px;
    height: 14px;
    background: #d8dfe8;
}

.nav-meta {
    white-space: nowrap;
}

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, #eaf2ff 0%, #f5f8ff 50%, #ffffff 100%);
    padding: 32px 0 28px;
    position: relative;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    top: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(47, 111, 237, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.hero::before {
    left: 0;
}

.hero::after {
    right: 0;
}

.hero .container {
    text-align: center;
    position: relative;
    z-index: 1;
}
.hero-title,
.hero-desc,
.hero-groups,
.hero-group {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.2;
    margin: 0;
    letter-spacing: 1px;
}

.hero-desc {
    color: #6b7a90;
    font-size: 15px;
    margin: 14px auto 32px;
    max-width: 560px;
    line-height: 1.8;
    letter-spacing: 0.3px;
}

.hero-groups {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
    max-width: 100%;
}

.hero-group {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(15, 30, 60, 0.04);
    transition: border-color 0.15s, transform 0.15s;
}

.hero-group:hover {
    border-color: #d8e2f5;
    transform: translateY(-1px);
}

.hero-group-label {
    color: #6b7a90;
    font-size: 13px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.hero-group-value {
    color: #2f6fed;
    font-size: 17px;
    font-weight: 700;
    font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;
    letter-spacing: 1px;
    user-select: all;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
    padding-right: 8px;
}

.hero-group-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #2f6fed;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s;
}

.hero-group-btn:hover {
    background: #1f5fd9;
    transform: translateY(-1px);
}

/* ============ 通用按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
    font-family: inherit;
}

.btn-primary {
    background: #2f6fed;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1f5fd9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 111, 237, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: #1a2332;
    border-color: #d8dfe8;
}

.btn-secondary:hover {
    border-color: #2f6fed;
    color: #2f6fed;
    transform: translateY(-1px);
}

/* ============ Section ============ */
.section {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 32px 0;
}

.section-white {
    background: #ffffff;
}

.section-gray {
    background: #f7f9fc;
}

/* 站点区块：自适应撑开剩余空间 */
#sites.section {
    padding-bottom: 24px;
    flex: 1 1 auto;
    min-height: 0;
}

/* 友情链接区块：浅色背景，紧跟站点底部 */
.section-friends {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    padding: 24px 0 24px;
    flex: 0 0 auto;
}

.section-title {
    text-align: center;
    margin: 0 auto 32px;
    max-width: 720px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.section-title p {
    color: #6b7a90;
    font-size: 15px;
}

/* ============ 站点平铺 ============ */
.group-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto;
}

.site {
    position: relative;
    display: block;
    padding: 24px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid #d4dff5;
    border-radius: 12px;
    text-decoration: none;
    color: #1a2332;
    transition: all 0.18s;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(47, 111, 237, 0.08);
}

.site:hover {
    border-color: #2f6fed;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(47, 111, 237, 0.18);
}

.site::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2f6fed, #6c5ce7);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.site:hover {
    border-color: #d8e2f5;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 30, 60, 0.06);
}

.site:hover::before {
    transform: scaleX(1);
}

.site-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a2332;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.site:hover .site-name {
    color: #2f6fed;
}

.site-arrow {
    flex-shrink: 0;
    color: #95a3b8;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.18s, transform 0.18s, color 0.18s;
}

.site-arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.site:hover .site-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #2f6fed;
}

.site-desc {
    font-size: 13px;
    color: #6b7a90;
    line-height: 1.5;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============ 友情链接 ============ */
.section-friends .section-title h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.section-friends .section-title p {
    font-size: 13px;
}

.friends-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1100px;
    margin: 0 auto;
}

.friend {
    display: inline-block;
    padding: 7px 18px;
    background: #ffffff;
    border: 1px solid #d4dff5;
    border-radius: 999px;
    text-decoration: none;
    color: #1a2332;
    transition: all 0.15s;
    font-size: 13px;
}

.friend:hover {
    background: #ffffff;
    border-color: #2f6fed;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 111, 237, 0.12);
}

.friend-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a2332;
    transition: color 0.15s;
}

.friend:hover .friend-name {
    color: #2f6fed;
}

/* ============ 页脚 ============ */
.footer {
    background: #1a2332;
    color: #6b7a90;
    padding: 28px 0;
    margin-top: auto;
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    max-width: 100%;
    min-width: 0;
}

.footer-bottom a,
.footer-bottom span {
    min-width: 0;
    word-break: break-all;
}

.footer-bottom a {
    color: #95a3b8;
    transition: color 0.15s;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* ============ 终极兜底：禁止任何横向滚动 ============ */
html, body {
    max-width: 100vw;
}
body {
    overflow-x: hidden;
}
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    /* 导航：横向，左 logo 右 QQ */
    .nav-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 16px;
    }
    .nav-brand {
        font-size: 15px;
        gap: 8px;
        min-width: 0;
    }
    .nav-brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nav-logo {
        height: 30px;
        flex-shrink: 0;
    }
    .nav-info {
        flex-wrap: nowrap;
        justify-content: flex-end;
        font-size: 12px;
        gap: 6px;
    }
    .nav-meta {
        white-space: nowrap;
    }
    .nav-divider {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 22px 0 20px;
    }
    .hero-title {
        font-size: 26px;
        letter-spacing: 0.5px;
    }
    .hero-desc {
        font-size: 13px;
        margin: 10px auto 22px;
        line-height: 1.7;
    }
    .hero-groups {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .hero-group {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        padding: 10px 14px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        text-align: left;
        box-sizing: border-box;
    }
    .hero-group-label {
        font-size: 12px;
        min-width: 0;
        overflow-wrap: anywhere;
        flex-shrink: 1;
    }
    .hero-group-value {
        font-size: 15px;
        min-width: 0;
        overflow-wrap: anywhere;
        flex-shrink: 0;
    }
    .hero-group-btn {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* 区块 */
    .section {
        padding: 22px 0;
    }
    #sites.section {
        padding-bottom: 18px;
        flex: 0 0 auto;
    }
    .section-friends {
        padding: 18px 0 !important;
        flex: 0 0 auto;
    }
    .section-title {
        margin: 0 auto 22px;
    }
    .section-title h2 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    .section-title p {
        font-size: 13px;
    }
    .section-friends .section-title h2 {
        font-size: 20px;
    }
    .section-friends .section-title p {
        font-size: 12px;
    }

    /* 站点平铺 */
    .group-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .site {
        padding: 16px 14px;
        border-radius: 10px;
        box-sizing: border-box;
    }
    .site-name {
        font-size: 16px;
        gap: 6px;
    }
    .site-desc {
        font-size: 12px;
    }

    /* 友情链接 */
    .friends-list {
        gap: 8px;
    }
    .friend {
        padding: 6px 14px;
        font-size: 12px;
    }
    .friend-name {
        font-size: 13px;
    }

    /* 页脚 */
    .footer {
        padding: 18px 0 20px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 11px;
    }
}

/* 小屏手机 (<= 380px) */
@media (max-width: 380px) {
    .nav-inner {
        padding: 8px 12px;
        gap: 8px;
    }
    .nav-brand {
        font-size: 14px;
        gap: 6px;
    }
    .nav-logo {
        height: 26px;
    }
    .nav-info {
        font-size: 11px;
    }
    .hero-title {
        font-size: 22px;
    }
    .hero-desc {
        font-size: 12px;
    }
    .section-title h2 {
        font-size: 20px;
    }
}