* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "PingFang SC",
        "Microsoft YaHei",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background:
        linear-gradient(
            180deg,
            #020817 0%,
            #040d1d 45%,
            #071428 100%
        );
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   星空背景
   ============================================ */

.sky {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

/* 星云 */
.sky::before {
    content: "";
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 20% 30%,
            rgba(80, 120, 255, .16),
            transparent 25%),
        radial-gradient(circle at 80% 20%,
            rgba(120, 180, 255, .08),
            transparent 20%),
        radial-gradient(circle at 50% 70%,
            rgba(120, 120, 255, .10),
            transparent 30%);
    filter: blur(90px);
    animation:
        nebulaFloat 18s ease-in-out infinite alternate;
}

/* 微光 */
.sky::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 10%;
    width: min(600px, 80vw);
    height: min(200px, 30vw);
    transform: translateX(-50%);
    background:
        radial-gradient(
            ellipse,
            rgba(120, 160, 255, .18),
            transparent 70%
        );
    filter: blur(70px);
    animation:
        glowFloat 6s ease-in-out infinite alternate;
}

/* ============================================
   Scroll Snap 容器
   ============================================ */

.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* ============================================
   通用 section
   ============================================ */

section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ============================================
   第一屏 - Hero
   ============================================ */

.hero {
    text-align: center;
    padding: 40px 24px;
}

.hero-content {
    max-width: 900px;
    width: 100%;
}

.hero h1 {
    color: white;
    font-size: clamp(48px, 10vw, 110px);
    font-weight: 200;
    letter-spacing: clamp(4px, 1vw, 10px);
    text-shadow: 0 0 25px rgba(180, 220, 255, .35);
    line-height: 1.2;
}

.hero p {
    margin-top: clamp(16px, 3vh, 30px);
    color: rgba(255, 255, 255, .68);
    letter-spacing: clamp(4px, 0.8vw, 10px);
    font-size: clamp(14px, 2vw, 20px);
    line-height: 1.6;
}

/* 向下探索 */
.scroll-tip {
    margin-top: clamp(40px, 8vh, 90px);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, .45);
    letter-spacing: 4px;
    font-size: 13px;
    animation: fadeInUp 1.2s ease 0.5s both;
}

/* 鼠标 */
.mouse {
    width: 34px;
    height: 58px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 30px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
    margin-bottom: 18px;
}

/* 滚轮 */
.wheel {
    width: 4px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    animation: wheelMove 1.6s infinite;
}

/* ============================================
   第二屏 - 主页面
   ============================================ */

.main-page {
    padding: clamp(60px, 8vh, 120px) clamp(16px, 5vw, 80px);
    align-items: flex-start;
    overflow-y: auto;
}

.main-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

/* 顶部 */
.portal-header {
    text-align: center;
    margin-bottom: clamp(30px, 5vh, 80px);
}

/* 标签 */
.portal-tag {
    display: inline-block;
    padding: clamp(6px, 1vw, 10px) clamp(12px, 2vw, 18px);
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .6);
    letter-spacing: 3px;
    font-size: clamp(10px, 1.2vw, 12px);
    margin-bottom: clamp(12px, 2vh, 24px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* 标题 */
.portal-header h2 {
    font-size: clamp(36px, 8vw, 96px);
    color: white;
    font-weight: 200;
    letter-spacing: clamp(3px, 0.6vw, 6px);
    margin-bottom: clamp(10px, 2vh, 20px);
    line-height: 1.2;
}

/* 描述 */
.portal-header p {
    color: rgba(255, 255, 255, .48);
    font-size: clamp(14px, 1.6vw, 18px);
    letter-spacing: 2px;
    line-height: 1.6;
}

/* ============================================
   搜索区域
   ============================================ */

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto clamp(30px, 5vh, 70px);
    padding: clamp(20px, 3vw, 34px);
    border-radius: clamp(24px, 3vw, 42px);
    overflow: hidden;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .06),
            rgba(255, 255, 255, .02)
        );
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .32);
    transition: .45s;
}

.search-wrapper:hover {
    border: 1px solid rgba(120, 160, 255, .24);
    box-shadow:
        0 35px 120px rgba(0, 0, 0, .45),
        0 0 80px rgba(120, 160, 255, .16);
}

/* 微光 */
.search-glow {
    position: absolute;
    top: -120px;
    right: -120px;
    width: clamp(200px, 30vw, 340px);
    height: clamp(200px, 30vw, 340px);
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(120, 160, 255, .22),
            transparent 70%
        );
    opacity: .8;
    pointer-events: none;
}

/* 引擎区域 */
.engine-switcher {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 14px);
    flex-wrap: wrap;
    margin-bottom: clamp(16px, 2.5vh, 28px);
}

/* 引擎按钮 */
.engine-btn {
    padding: clamp(10px, 1.2vw, 14px) clamp(18px, 2.5vw, 26px);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .55);
    font-size: clamp(12px, 1.2vw, 13px);
    letter-spacing: 3px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: .35s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.engine-btn:hover {
    color: white;
    border: 1px solid rgba(120, 160, 255, .22);
    background: rgba(120, 160, 255, .08);
}

.engine-btn:active {
    transform: scale(0.96);
}

.engine-btn.active {
    color: white;
    background:
        linear-gradient(
            180deg,
            rgba(120, 160, 255, .22),
            rgba(120, 160, 255, .08)
        );
    border: 1px solid rgba(120, 160, 255, .28);
    box-shadow: 0 0 24px rgba(120, 160, 255, .16);
}

/* 搜索框 */
.search-box {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: .35s;
}

.search-box:hover {
    border: 1px solid rgba(120, 160, 255, .22);
}

.search-box:focus-within {
    border: 1px solid rgba(120, 160, 255, .35);
    box-shadow: 0 0 30px rgba(120, 160, 255, .10);
}

/* 输入 */
.search-box input {
    flex: 1;
    min-width: 0;
    height: clamp(48px, 6vh, 74px);
    padding: 0 clamp(16px, 3vw, 32px);
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: clamp(15px, 1.6vw, 18px);
    letter-spacing: 1px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, .35);
}

/* 搜索按钮 */
.search-box button {
    height: clamp(48px, 6vh, 74px);
    padding: 0 clamp(20px, 3vw, 44px);
    border: none;
    background: rgba(120, 160, 255, .12);
    color: white;
    font-size: clamp(12px, 1.2vw, 14px);
    letter-spacing: 4px;
    cursor: pointer;
    transition: .35s;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.search-box button:hover {
    background: rgba(120, 160, 255, .24);
}

.search-box button:active {
    background: rgba(120, 160, 255, .32);
}

/* ============================================
   卡片网格
   ============================================ */

.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 2.5vw, 36px);
}

/* 卡片 */
.portal-card {
    position: relative;
    overflow: hidden;
    min-height: clamp(180px, 25vh, 290px);
    padding: clamp(24px, 4vw, 54px);
    border-radius: clamp(24px, 3vw, 40px);
    text-decoration: none;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .045),
            rgba(255, 255, 255, .015)
        );
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .03),
        0 20px 60px rgba(0, 0, 0, .28);
    transition: all .55s cubic-bezier(.22, 1, .36, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* hover效果 */
@media (hover: hover) {
    .portal-card:hover {
        transform: translateY(-16px) scale(1.025);
        border: 1px solid rgba(120, 160, 255, .28);
        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, .07),
                rgba(255, 255, 255, .02)
            );
        box-shadow:
            0 35px 100px rgba(0, 0, 0, .48),
            0 0 80px rgba(120, 160, 255, .16);
    }

    .portal-card:hover .card-shine {
        left: 140%;
    }

    .portal-card:hover .card-glow {
        opacity: 1;
    }

    .portal-card:hover .card-icon {
        transform: scale(1.18);
        color: rgba(255, 255, 255, .16);
    }
}

/* 触屏设备点击反馈 */
@media (hover: none) {
    .portal-card:active {
        transform: scale(0.97);
        border: 1px solid rgba(120, 160, 255, .28);
    }
}

/* 流光 */
.card-shine {
    position: absolute;
    top: -150%;
    left: -60%;
    width: 80px;
    height: 500px;
    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(255, 255, 255, .18),
            transparent
        );
    transform: rotate(25deg);
    transition: 1s;
}

/* 发光 */
.card-glow {
    position: absolute;
    width: clamp(160px, 20vw, 260px);
    height: clamp(160px, 20vw, 260px);
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            rgba(120, 160, 255, .20),
            transparent 70%
        );
    top: -100px;
    right: -100px;
    opacity: 0;
    transition: .5s;
}

/* 图标 */
.card-icon {
    position: absolute;
    right: clamp(20px, 3vw, 40px);
    bottom: clamp(14px, 2vh, 24px);
    font-size: clamp(40px, 6vw, 78px);
    color: rgba(255, 255, 255, .08);
    transition: .5s;
    pointer-events: none;
}

/* 在线状态 */
.node-status {
    position: absolute;
    top: clamp(20px, 3vh, 40px);
    right: clamp(20px, 3vw, 40px);
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .55);
    font-size: clamp(11px, 1vw, 12px);
    letter-spacing: 3px;
}

/* 在线绿点 */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7dffb3;
    box-shadow: 0 0 12px #7dffb3;
    animation: pulse 2s infinite;
}

/* 顶部英文 */
.card-top {
    color: rgba(255, 255, 255, .35);
    font-size: clamp(11px, 1vw, 12px);
    letter-spacing: 4px;
    margin-bottom: clamp(16px, 2.5vh, 34px);
    position: relative;
    z-index: 2;
}

/* 标题 */
.portal-card h3 {
    color: white;
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: clamp(12px, 2vh, 22px);
    position: relative;
    z-index: 2;
    line-height: 1.3;
}

/* 描述 */
.portal-card span {
    color: rgba(255, 255, 255, .5);
    line-height: 1.8;
    font-size: clamp(13px, 1.2vw, 15px);
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

/* ============================================
   新增：页脚
   ============================================ */

.site-footer {
    scroll-snap-align: end;
    padding: clamp(30px, 5vh, 60px) clamp(16px, 5vw, 80px);
    text-align: center;
    color: rgba(255, 255, 255, .25);
    font-size: clamp(11px, 1vw, 13px);
    letter-spacing: 2px;
    line-height: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    height: auto;
}

.site-footer .footer-divider {
    width: clamp(40px, 6vw, 80px);
    height: 1px;
    background: rgba(255, 255, 255, .10);
    margin-bottom: clamp(16px, 3vh, 24px);
}

.site-footer a {
    color: rgba(255, 255, 255, .35);
    text-decoration: none;
    transition: .3s;
}

.site-footer a:hover {
    color: rgba(255, 255, 255, .6);
}

.site-footer .icp-beian {
    margin-top: 8px;
}

.site-footer .icp-beian a {
    color: rgba(255, 255, 255, .20);
    font-size: clamp(10px, 0.9vw, 12px);
    letter-spacing: 1px;
    transition: .3s;
}

.site-footer .icp-beian a:hover {
    color: rgba(255, 255, 255, .45);
}

/* ============================================
   星星
   ============================================ */

.star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    animation: twinkle 3s infinite alternate;
    pointer-events: none;
}

/* 流星 */
.meteor {
    position: fixed;
    width: clamp(80px, 12vw, 160px);
    height: 2px;
    background:
        linear-gradient(
            90deg,
            white,
            transparent
        );
    transform: rotate(-35deg);
    animation: meteorMove 3s linear forwards;
    pointer-events: none;
}

/* ============================================
   动画
   ============================================ */

@keyframes twinkle {
    from { opacity: .2; }
    to { opacity: 1; }
}

@keyframes meteorMove {
    from {
        transform: translate(0, 0) rotate(-35deg);
        opacity: 1;
    }
    to {
        transform: translate(-800px, 600px) rotate(-35deg);
        opacity: 0;
    }
}

@keyframes wheelMove {
    0% {
        opacity: 0;
        transform: translateY(0px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(14px);
    }
}

@keyframes nebulaFloat {
    from { transform: translateY(0px); }
    to { transform: translateY(-20px); }
}

@keyframes glowFloat {
    from { opacity: .45; }
    to { opacity: .85; }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: .6;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: .6;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   响应式：平板 (768px - 1024px)
   ============================================ */

@media (max-width: 1024px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .portal-card {
        min-height: 200px;
        padding: 32px;
    }

    .portal-card h3 {
        font-size: 28px;
    }

    .main-page {
        padding: 80px 32px 40px;
    }

    .search-wrapper {
        padding: 24px;
    }
}

/* ============================================
   响应式：手机 (<= 768px)
   ============================================ */

@media (max-width: 768px) {
    .hero {
        padding: 24px 16px;
    }

    .hero h1 {
        font-size: clamp(36px, 12vw, 48px);
        letter-spacing: 3px;
    }

    .hero p {
        font-size: 14px;
        letter-spacing: 3px;
        margin-top: 12px;
    }

    .scroll-tip {
        margin-top: 40px;
    }

    .mouse {
        width: 28px;
        height: 48px;
        padding-top: 8px;
    }

    .wheel {
        width: 3px;
        height: 8px;
    }

    .main-page {
        padding: 60px 16px 30px;
    }

    .portal-header {
        margin-bottom: 24px;
    }

    .portal-header h2 {
        font-size: clamp(28px, 10vw, 36px);
        letter-spacing: 2px;
    }

    .portal-header p {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .portal-tag {
        font-size: 10px;
        padding: 6px 12px;
        margin-bottom: 12px;
    }

    .search-wrapper {
        padding: 16px;
        border-radius: 20px;
        margin-bottom: 24px;
    }

    .engine-switcher {
        gap: 6px;
        margin-bottom: 12px;
    }

    .engine-btn {
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 2px;
    }

    .search-box input {
        height: 44px;
        font-size: 14px;
        padding: 0 14px;
    }

    .search-box button {
        height: 44px;
        padding: 0 16px;
        font-size: 11px;
        letter-spacing: 2px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portal-card {
        min-height: 160px;
        padding: 20px;
        border-radius: 20px;
    }

    .portal-card h3 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .portal-card span {
        font-size: 12px;
        line-height: 1.6;
    }

    .card-top {
        font-size: 10px;
        margin-bottom: 12px;
        letter-spacing: 3px;
    }

    .card-icon {
        font-size: 32px;
        right: 16px;
        bottom: 12px;
    }

    .card-glow {
        width: 120px;
        height: 120px;
        top: -60px;
        right: -60px;
    }

    .node-status {
        top: 16px;
        right: 16px;
        font-size: 10px;
        gap: 6px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .site-footer {
        padding: 24px 16px;
        font-size: 10px;
    }
}

/* ============================================
   响应式：极小屏 (<= 400px)
   ============================================ */

@media (max-width: 400px) {
    .hero h1 {
        font-size: 28px;
    }

    .search-box {
        flex-direction: column;
        border-radius: 16px;
        overflow: hidden;
    }

    .search-box input {
        width: 100%;
        height: 40px;
        font-size: 13px;
        border-bottom: 1px solid rgba(255, 255, 255, .06);
    }

    .search-box button {
        width: 100%;
        height: 40px;
        font-size: 11px;
    }

    .portal-card {
        min-height: 140px;
        padding: 16px;
    }

    .portal-card h3 {
        font-size: 18px;
    }
}

/* ============================================
   响应式：大屏 (>= 1920px)
   ============================================ */

@media (min-width: 1920px) {
    .main-content {
        max-width: 1400px;
    }

    .hero h1 {
        font-size: 130px;
    }

    .portal-header h2 {
        font-size: 110px;
    }

    .portal-grid {
        gap: 40px;
    }

    .portal-card {
        min-height: 320px;
        padding: 60px;
    }

    .portal-card h3 {
        font-size: 48px;
    }
}

/* ============================================
   安全区域适配 (刘海屏)
   ============================================ */

@supports (padding: env(safe-area-inset-top)) {
    .hero {
        padding-top: calc(40px + env(safe-area-inset-top));
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }

    .main-page {
        padding-top: calc(60px + env(safe-area-inset-top));
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }

    .site-footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   减少运动偏好
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-container {
        scroll-behavior: auto;
    }
}

/* ============================================
   打印样式
   ============================================ */

@media print {
    .sky,
    .star,
    .meteor,
    .scroll-tip {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .portal-card {
        break-inside: avoid;
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
    }

    .portal-card h3,
    .portal-header h2,
    .hero h1 {
        color: black !important;
    }
}
