/* 全屏门户遮罩 */
#portal{
    position: fixed; inset: 0; z-index: 2147483000; /* 顶层 */
    display: flex; align-items: flex-start; justify-content: center;
    background: #07090e; overflow: hidden; opacity: 1; transition: opacity .45s ease;
    padding-top: 15vh;
}
#portal.hiding{ opacity: 0; pointer-events: none; }


/* ===== 顶部登录按钮 ===== */
#portal-auth-btn.portal-auth-btn {
    position: fixed;
    right: 20px;
    top: 16px;
    z-index: 2147483600;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: radial-gradient(circle at 0 0,
    rgba(120, 180, 255, 0.26),
    rgba(8, 12, 24, 0.96));
    color: #eef3ff;
    backdrop-filter: blur(10px);
    font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
    transition:
            transform 0.18s ease,
            box-shadow 0.18s ease,
            background 0.18s ease,
            border-color 0.18s ease,
            opacity 0.18s ease;
}

#portal-auth-btn.portal-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
    border-color: rgba(180, 210, 255, 0.9);
    background: radial-gradient(circle at 0 0,
    rgba(150, 200, 255, 0.34),
    rgba(12, 18, 32, 0.98));
}

#portal-auth-btn.portal-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    opacity: 0.92;
}

/* ===== 登录/注册弹窗整体（全屏遮罩） ===== */
#auth-modal.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483601;
    display: none;                /* 通过 .show 切换 */
    align-items: center;
    justify-content: center;
    background: rgba(4, 6, 12, 0.70);
    backdrop-filter: blur(16px);
}

#auth-modal.auth-modal.show {
    display: flex;
}

/* ===== 弹窗卡片 ===== */
.auth-dialog {
    width: 420px;
    max-width: 92vw;
    max-height: 90vh;
    background: radial-gradient(circle at 0 0,
    rgba(120, 170, 255, 0.18),
    rgba(9, 11, 18, 0.96));
    border-radius: 18px;
    border: 1px solid rgba(180, 210, 255, 0.18);
    box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.82),
            0 0 0 1px rgba(0, 0, 0, 0.6) inset;
    padding: 20px 20px 16px;
    color: #f5f7ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    font-size: 15px;              /* ★ 整体文字略大 */
    line-height: 1.5;
}

/* 头部 */
.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f2f5ff;
}

.auth-close {
    border: none;
    background: transparent;
    color: #a5adc2;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.16s ease, transform 0.16s ease;
}

.auth-close:hover {
    color: #ffffff;
    transform: rotate(6deg);
}

/* Tab 切换 */
#auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: rgba(10, 14, 24, 0.9);
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(115, 170, 255, 0.45);
}

#auth-tabs button[data-tab] {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 6px 0;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: #aab1c7;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#auth-tabs button[data-tab].active {
    background: radial-gradient(circle at 20% 0%, #3e8bff, #7dd9ff);
    color: #050913;
    box-shadow: 0 0 14px rgba(70, 140, 255, 0.65);
}

/* 表单 */
.auth-field {
    margin-bottom: 11px;
}

.auth-label {
    margin-bottom: 4px;
    font-size: 13px;
    color: #c1c7de;
}

.auth-input {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(200, 215, 255, 0.22);
    background: rgba(6, 10, 18, 0.96);
    color: #f5f7ff;
    font-size: 14px;
    outline: none;
    transition:
            border-color 0.16s ease,
            box-shadow 0.16s ease,
            background 0.16s ease;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: rgba(180, 188, 216, 0.78);
}

.auth-input:focus {
    border-color: rgba(112, 178, 255, 0.95);
    box-shadow:
            0 0 0 1px rgba(112, 178, 255, 0.6),
            0 0 14px rgba(60, 130, 255, 0.45);
    background: rgba(9, 13, 22, 0.98);
}

/* 提交按钮 */
.auth-submit {
    width: 100%;
    padding: 9px 0;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
    transition:
            transform 0.16s ease,
            box-shadow 0.16s ease,
            opacity 0.16s ease,
            filter 0.16s ease;
}

#auth-login-submit.auth-submit {
    background: linear-gradient(135deg, #3f8cff, #35c5ff);
    color: #ffffff;
}

#auth-reg-submit.auth-submit {
    background: linear-gradient(135deg, #46e2b7, #37c3ff);
    color: #02121b;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.72);
    filter: brightness(1.03);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.65);
    opacity: 0.94;
}

/* 小提示文字 */
.auth-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #8f95ad;
}
/* 确认密码 / 错误提示 */
.auth-error {
    margin-top: 4px;
    font-size: 12px;
    color: #ff7b7b;
    display: none;
}

.auth-error.show {
    display: block;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .auth-error {
        font-size: 12px;
    }
}
/* 验证码输入 + 按钮行 */
.auth-field-inline .auth-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
}

.auth-field-inline .auth-input {
    flex: 1;
}

/* 获取验证码的小按钮 */
.auth-code-btn {
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(150, 190, 255, 0.7);
    background: radial-gradient(circle at 0 0,
    rgba(120, 170, 255, 0.22),
    rgba(10, 16, 30, 0.95));
    color: #e5ecff;
    font-size: 12px;
    cursor: pointer;
    transition:
            background 0.18s ease,
            box-shadow 0.18s ease,
            transform 0.18s ease,
            border-color 0.18s ease;
}

.auth-code-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(190, 220, 255, 0.95);
    box-shadow: 0 6px 18px rgba(80, 140, 255, 0.6);
}

.auth-code-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(60, 110, 220, 0.6);
}


/* ===== 手机端适配 ===== */
@media (max-width: 768px) {
    #portal-auth-btn.portal-auth-btn {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 13px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
    }

    .auth-dialog {
        width: 92vw;
        padding: 16px 14px 12px;
        border-radius: 16px;
        font-size: 14px;
    }

    .auth-title {
        font-size: 18px;
    }

    .auth-input {
        padding: 7px 9px;
        font-size: 13px;
    }

    #auth-tabs button[data-tab] {
        font-size: 12px;
        padding: 5px 0;
    }
}

/* 添加底图容器：延迟加载 + 柔和波纹显示 */
#portal-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* 初始完全不可见，等 JS 预加载完再动画展示 */
    opacity: 0;
    pointer-events: none;
    z-index: 0;

    /* 全程保持同一组亮度 / 饱和度，让人眼感觉不到“变暗一下” */
    filter: brightness(0.86) saturate(0.9);

    transform: translateZ(0);
}

/* 背景图加载完成后触发波纹动画（PC 端） */
#portal.bg-show-bg #portal-bg-image {
    animation: portalBgRipple 1.6s cubic-bezier(.2,.85,.3,1) forwards;
}

/* PC 端波纹：中心稍微停留 → 再均匀扩散到全屏 */
@keyframes portalBgRipple {
    0% {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
        transform: scale(1.03);
        filter: brightness(0.86) saturate(0.95) blur(1.5px);
    }
    30% {
        opacity: 0.26;
        clip-path: circle(28% at 50% 50%);
        transform: scale(1.01);
        filter: brightness(0.86) saturate(0.95) blur(0.8px);
    }
    55% {
        opacity: 0.26;
        clip-path: circle(38% at 50% 50%);
        transform: scale(1.0);
        filter: brightness(0.86) saturate(0.95) blur(0.4px);
    }
    80% {
        opacity: 0.26;
        clip-path: circle(75% at 50% 50%);
        transform: scale(1.0);
        filter: brightness(0.86) saturate(0.95) blur(0);
    }
    100% {
        opacity: 0.26;
        clip-path: circle(110% at 50% 50%);
        transform: scale(1.0);
        filter: brightness(0.86) saturate(0.9) blur(0);
    }
}

/* 📱 手机端：关闭剪裁波纹动画，改成纯淡入，避免最后一瞬间的屏闪 */
@media (max-width: 768px) {
    #portal-bg-image {
        clip-path: none;
    }

    #portal.bg-show-bg #portal-bg-image {
        will-change: opacity, clip-path;
        animation: portalBgFade 0.9s ease-out forwards;
    }

    @keyframes portalBgFade {
        0% {
            opacity: 0;
            filter: brightness(0.86) saturate(0.9);
        }
        100% {
            opacity: 0.26;
            filter: brightness(0.86) saturate(0.9);
        }
    }
}



/* 银河画布：不拦截点击，按钮可点 */
#portal-canvas{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    pointer-events:none;
    z-index: 1; /* 在底图之上 */
}

/* 中央文案与按钮 */
#portal-inner{
    position: relative;
    z-index: 2; /* 在最上层 */
    text-align: center;
    color:#e8e8ea;
    padding:24px;
    display:flex;
    flex-direction:column;
    align-items:center;
    user-select:none;
    margin-top:120px;
    gap: 0.5rem;
}

#portal-title-wrapper{ margin-bottom: 3rem; }

#portal-title{
    font-size:4.5rem; font-weight:360; letter-spacing:2px;
    background: linear-gradient(135deg, #07b5ff 0%, #ffffff 50%, #73b7ed 100%);
    -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
    text-shadow:0 0 30px rgba(168,192,255,.3);
    animation:titleGlow 3s ease-in-out infinite alternate;
    font-family:'Segoe UI','Microsoft YaHei',sans-serif; margin-top:-40px;
}

#portal-sub{
    margin:0 0 2rem; font-size:1.4rem; opacity:.9; color:#b8c7ff; font-weight:300; letter-spacing:4px;
    text-shadow:0 0 20px rgba(184,199,255,.4); font-family:'Microsoft YaHei','SimHei',sans-serif;
}

/* 两个按钮容器 */
#portal-btn-group{
    display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-top:0.5rem;
}

/* 通用按钮（兼容旧 #portal-start） */
.portal-btn, #portal-start{
    appearance:none; border:1px solid rgba(255,255,255,.12); border-radius:30px;
    padding:.7rem 1.8rem; font-weight:600; font-size:1.15rem; cursor:pointer; color:#e8eeff;
    background:linear-gradient(135deg, rgba(63,94,251,.20) 0%, rgba(252,70,107,.20) 100%);
    box-shadow:0 8px 32px rgba(50,73,157,.30); transition:all .3s ease; backdrop-filter:blur(10px);
    position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:.8rem; letter-spacing:1px;
}

/* 光效条 */
.portal-btn::before, #portal-start::before{
    content:""; position:absolute; top:0; left:-100%; width:100%; height:100%;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);
    transition:left .5s ease;
}
.portal-btn:hover::before, #portal-start:hover::before{ left:100%; }

.portal-btn:hover, #portal-start:hover{
    transform:translateY(-2px); box-shadow:0 12px 40px rgba(63,94,251,.40);
    border-color:rgba(255,255,255,.28); filter:brightness(1.06);
}
.portal-btn:active, #portal-start:active{ transform:translateY(0) scale(.98); }

.btn-text{ position:relative; z-index:1; }
.btn-arrow{ position:relative; z-index:1; transition: transform .3s ease; }
.portal-btn:hover .btn-arrow, #portal-start:hover .btn-arrow{ transform: translateX(4px); }

/* 两个主题按钮 */
#portal-start-china{
    color:#0b0e17; background: linear-gradient(135deg,#7fb1ff,#4be1ff); border-color:transparent;
}
#portal-start-china:hover{ filter: brightness(1.05); }
#portal-start-globe{
    background: linear-gradient(135deg, rgba(63,94,251,.18) 0%, rgba(124,77,255,.18) 100%);
    border-color: rgba(150,170,255,.35);
}

/* 装饰文案 */
#portal-ornament{ font-size:1.2rem; color:#6d8cff; letter-spacing:8px; opacity:.6; margin-top:1rem; }

/* 标题发光动画 */
@keyframes titleGlow{
    0%{ text-shadow:0 0 30px rgba(168,192,255,.35), 0 0 40px rgba(63,94,251,.2); }
    100%{ text-shadow:0 0 40px rgba(168,192,255,.55), 0 0 60px rgba(63,94,251,.3), 0 0 80px rgba(252,70,107,.12); }
}

/* 中央柔光 */
#portal::after{
    content:""; position:absolute; left:50%; top:50%; width:40vmin; height:40vmin; transform:translate(-50%,-50%);
    border-radius:50%; background: radial-gradient(closest-side, rgba(168,192,255,.10), rgba(168,192,255,0));
    pointer-events:none;
}

/* 高度限制下的适配 */
@media (max-height:700px){
    #portal{ padding-top:10vh; }
    #portal-title{ font-size:3.5rem; }
    #portal-sub{ font-size:1.2rem; }
}

/* 联系作者按钮（PC 基础） */
.contact-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483001;
    padding: 8px 16px;
    background: rgba(63, 94, 251, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #b8c7ff;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* 关于网站按钮：PC 端放在左侧一点 */
.about-btn {
    right: 130px;
    bottom: 20px;
    position: fixed;
    z-index: 2147483001;
    padding: 8px 16px;
    background: rgba(63, 94, 251, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #b8c7ff;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.contact-btn:hover,
.about-btn:hover {
    background: rgba(63, 94, 251, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 联系弹窗 */
.contact-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    background: rgba(7, 9, 14, 0.8);
    backdrop-filter: blur(8px);
}

.contact-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 25, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.contact-content h3 {
    color: #e8eeff;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.contact-email {
    margin-bottom: 25px;
    padding: 12px;
    background: rgba(63, 94, 251, 0.1);
    border-radius: 8px;
    text-align: center;
}

.contact-email span {
    color: #7fb1ff;
    font-size: 1.1rem;
}

.contact-input-group label {
    display: block;
    color: #b8c7ff;
    margin-bottom: 10px;
    font-size: 1rem;
}

#contact-message {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #e8e8ea;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

#contact-message::placeholder {
    color: rgba(184, 199, 255, 0.5);
    font-style: italic;
}

#contact-message:focus {
    outline: none;
    border-color: rgba(63, 94, 251, 0.5);
}

.char-count {
    text-align: right;
    color: rgba(184, 199, 255, 0.6);
    font-size: 12px;
    margin-top: 5px;
}

.contact-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.send-btn, .close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.send-btn {
    background: linear-gradient(135deg, #3f5efb, #7fb1ff);
    color: white;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #b8c7ff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(63, 94, 251, 0.4);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== 水瀑布式多层边框（PC 端动态） ===== */
#portal-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity .45s ease; /* 边框整体淡入 */
}

/* 静态外轮廓：改粗一点 + 把质感强调出来 */
.border-line {
    position: absolute;
    opacity: 0.95;
}

/* 上下静态线：高度加粗、发光更明显 */
.border-line.top,
.border-line.bottom {
    height: 3px;
    left: 1.5%;
    right: 1.5%;
    background: linear-gradient(
            90deg,
            rgba(0,0,0,0) 0%,
            rgba(120,190,255,0.25) 6%,
            rgba(167,214,255,0.85) 22%,
            rgba(190,230,255,1.0) 50%,
            rgba(167,214,255,0.85) 78%,
            rgba(120,190,255,0.25) 94%,
            rgba(0,0,0,0) 100%
    );

    box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.8),
            0 0 16px rgba(160, 215, 255, 0.8);
}

.border-line.top    { top: 1.2%; }
.border-line.bottom { bottom: 1.2%; }

/* 左右静态线：宽度加粗 + 上下呼应 */
.border-line.left,
.border-line.right {
    width: 3px;                  /* 原来 1px -> 3px */
    top: 1.2%;
    bottom: 1.2%;
    background: linear-gradient(
            180deg,
            rgba(0,0,0,0) 0%,
            rgba(120,190,255,0.22) 6%,
            rgba(167,214,255,0.82) 22%,
            rgba(190,230,255,1.0) 50%,
            rgba(167,214,255,0.82) 78%,
            rgba(120,190,255,0.22) 94%,
            rgba(0,0,0,0) 100%
    );
    box-shadow:
            0 0 14px rgba(160, 215, 255, 0.9),
            0 0 34px rgba(135, 206, 250, 0.55);
}

.border-line.left  { left: 1.2%; }
.border-line.right { right: 1.2%; }





/* ===== PC 端：四组线性外扩的瀑布边框 ===== */
.border-trail {
    position: absolute;
    inset: 2.0%;               /* 稍微往里一点，给它放大空间 */
    border-radius: 22px;
    pointer-events: none;

    border: 2px solid rgba(173, 216, 230, 0.9);
    background: transparent;

    box-shadow:
            0 0 18px rgba(135, 206, 250, 0.9),
            0 0 34px rgba(135, 206, 250, 0.6);

    opacity: 0;
    transform-origin: center center;
    transform: scale(0.90);

    /* 匀速从内往外扫 */
    animation-name: portalBorderSweep;
    animation-duration: 3.2s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* 四条线：上 / 下 / 左 / 右
   用“负 delay”让一进页面就处于动画中段，避免第一次闪一下 */
.border-trail.horizontal.top {
    animation-delay: -3.2s;   /* 第 1 条：完整周期的中段 */
}
.border-trail.horizontal.bottom {
    animation-delay: -1.6s;   /* 第 2 条：错开半个周期 */
}
.border-trail.vertical.left {
    display: block !important;
    animation-delay: -0.8s;   /* 第 3 条：再错开一点 */
}
.border-trail.vertical.right {
    display: block !important;
    animation-delay: 0s;      /* 第 4 条：从 0 起步，接在前面几条后面 */
}

/* 线性外扩：从中等亮度 → 靠近屏幕边缘 → 淡出 */
@keyframes portalBorderSweep {
    0% {
        transform: scale(0.90);
        opacity: 0.0;
        border-color: rgba(173, 216, 230, 0.0);
        box-shadow:
                0 0 8px rgba(135, 206, 250, 0.0),
                0 0 16px rgba(135, 206, 250, 0.0);
    }
    10% {
        transform: scale(0.93);
        opacity: 0.8;
        border-color: rgba(196, 236, 255, 0.9);
        box-shadow:
                0 0 22px rgba(135, 206, 250, 0.85),
                0 0 38px rgba(135, 206, 250, 0.7);
    }
    70% {
        transform: scale(1.05);   /* 差不多靠近屏幕边缘的位置 */
        opacity: 0.7;
        border-color: rgba(170, 225, 250, 0.85);
        box-shadow:
                0 0 20px rgba(135, 206, 250, 0.75),
                0 0 34px rgba(135, 206, 250, 0.5);
    }
    100% {
        transform: scale(1.10);   /* 再冲出一点然后消失 */
        opacity: 0.0;
        border-color: rgba(135, 206, 250, 0.0);
        box-shadow:
                0 0 12px rgba(135, 206, 250, 0.0),
                0 0 24px rgba(135, 206, 250, 0.0);
    }
}








/* 拐角 pulse（PC 用）：同时加粗一点，呼吸更明显 */
.corner-pulse {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%,
    rgba(0, 255, 255, 0.95) 0%,
    rgba(0, 255, 255, 0.85) 25%,
    rgba(0, 191, 255, 0.0) 65%);
    box-shadow:
            0 0 14px rgba(0, 255, 255, 0.8),
            0 0 28px rgba(30, 144, 255, 0.7);
}

.corner-pulse::before,
.corner-pulse::after {
    content: "";
    position: absolute;
    border-radius: 6px;
}
.corner-pulse::before {
    inset: 0;
    border: 1px solid rgba(135, 206, 250, 0.85);
    box-shadow: 0 0 12px rgba(135, 206, 250, 0.6);
}
.corner-pulse::after {
    inset: 6px;
    border: 1px solid rgba(135, 206, 250, 0.7);
}

/* 拐角位置保持不变，只是动画略加强一点 */
.corner-pulse.top-left {
    top: 1.2%;
    left: 1.2%;
    animation: cornerPulse 2.4s ease-in-out infinite;
}
.corner-pulse.top-right {
    top: 1.2%;
    right: 1.2%;
    animation: cornerPulse 2.4s ease-in-out infinite 0.4s;
}
.corner-pulse.bottom-left {
    bottom: 1.2%;
    left: 1.2%;
    animation: cornerPulse 2.4s ease-in-out infinite 0.8s;
}
.corner-pulse.bottom-right {
    bottom: 1.2%;
    right: 1.2%;
    animation: cornerPulse 2.4s ease-in-out infinite 1.2s;
}

@keyframes cornerPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.92);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

/* 动画控制：只在 border-show 时出现（PC） */
#portal.border-show #portal-border {
    opacity: 1;
}
#portal.border-show .border-trail,
#portal.border-show .corner-pulse {
    opacity: 1;
}

/* ===== 手机端：放弃动态边框，保留精致静态边框 & 布局优化 ===== */
@media (max-width: 768px) {

    /* 标题与副标题缩放一点 */
    #portal-title{
        font-size:3rem;
    }
    #portal-sub{
        font-size:1.1rem;
        letter-spacing:2px;
    }
    #portal-ornament{
        font-size:1rem;
        letter-spacing:6px;
    }
    .portal-btn, #portal-start{
        padding:.8rem 2rem;
        font-size:1.1rem;
    }

    /* 手机端隐藏“进入地球模式”按钮 */
    #portal-start-globe{
        display:none !important;
    }

    /* 🔹手机端：两个按钮放左上角（竖着排） */
    .contact-btn,
    .about-btn {
        left: 12px;
        right: auto;
        font-size: 13px;
        padding: 6px 12px;
        z-index: 2147483001;
    }
    .contact-btn {
        top: 12px;
        bottom: auto;
    }
    .about-btn {
        top: 48px;
        bottom: auto;
        display: inline-flex;
    }
    /* 🔹手机端：探索中国按钮稍微缩小一点 */
    #portal-start-china {
        padding: 0.55rem 1.4rem;
        font-size: 1.0rem;
    }



    /* 联系弹窗缩小一点，避免满屏压迫 */
    .contact-modal {
        padding: 12px;
        overflow-y: auto;
    }
    .contact-content {
        width: 92%;
        max-width: 360px;
        padding: 18px 16px;
        border-radius: 14px;
    }
    .contact-content h3 {
        font-size: 1.2rem;
        margin-bottom: 14px;
    }
    .contact-email span {
        font-size: 0.95rem;
    }
    #contact-message {
        height: 96px;
        font-size: 13px;
    }
    .contact-actions {
        gap: 8px;
        margin-top: 16px;
    }
    .send-btn,
    .close-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 手机端：边框改成纯静态样式，禁用所有动态元素 */
    #portal-border {
        opacity: 1;                 /* 始终显示静态边框 */
    }

    /* 动态水瀑布与拐角 pulse 统统关掉，不占资源也不闪烁 */
    .border-trail,
    .corner-pulse {
        display: none !important;
        opacity: 0 !important;
        animation: none !important;
    }
}





/* ========== 门户右侧公告栏 ========== */
/* 仅 PC 端：右侧小卡片 + 滚动内容；手机端在下面单独重写 */
#portal-announcement {
    position: absolute;
    right: 32px;
    top: 18vh;

    width: 280px;           /* ✅ 更窄一点 */
    max-height: 40vh;       /* ✅ 整体高度也压缩一点 */

    display: flex;
    flex-direction: column;

    padding: 12px 14px 10px;
    border-radius: 16px;

    border: 1px solid rgba(255, 255, 255, 0.14);

    background:
            linear-gradient(145deg,
            rgba(3, 6, 14, 0.98),
            rgba(9, 12, 22, 0.96)),
            radial-gradient(circle at top left,
            rgba(80, 120, 220, 0.30),
            rgba(3, 6, 14, 0.95));

    box-shadow:
            0 18px 46px rgba(0, 0, 0, 0.75),
            0 0 0 1px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(18px);

    color: #dde3ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    "PingFang SC", "Microsoft Yahei", sans-serif;
    font-size: 13px;        /* 稍微再小一点 */
    line-height: 1.7;

    z-index: 2147483200;
}

/* 双层边框质感 */
#portal-announcement::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.35);
    opacity: 0.9;
    pointer-events: none;
    mix-blend-mode: screen;
    box-shadow:
            0 0 0 1px rgba(90, 130, 255, 0.35),
            inset 0 0 25px rgba(40, 60, 130, 0.65);
}

/* 头部：标题 + 关闭按钮 */
#portal-announcement .pa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

#portal-announcement .pa-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d0daff;
}

#portal-announcement .pa-close {
    border: none;
    outline: none;
    background: transparent;
    color: #9ca7d9;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 999px;
}
#portal-announcement .pa-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* 内容区域：占满剩余空间，超出部分滚动 */
#portal-announcement .pa-body {
    flex: 1 1 auto;
    margin-top: 4px;
    padding-right: 4px;
    overflow-y: auto;               /* ✅ 这里控制滚动 */
}

/* 美化滚动条（仅 WebKit）可选 */
#portal-announcement .pa-body::-webkit-scrollbar {
    width: 6px;
}
#portal-announcement .pa-body::-webkit-scrollbar-track {
    background: transparent;
}
#portal-announcement .pa-body::-webkit-scrollbar-thumb {
    background: rgba(140, 160, 220, 0.55);
    border-radius: 999px;
}
#portal-announcement .pa-body::-webkit-scrollbar-thumb:hover {
    background: rgba(170, 190, 235, 0.85);
}

#portal-announcement p {
    margin: 4px 0;
}
#portal-announcement ul {
    margin: 4px 0 4px 18px;
    padding: 0;
}
#portal-announcement li {
    margin: 2px 0;
}

/* ===== 手机端适配：保持你原来的“底部大卡片”方案不变 ===== */
@media (max-width: 768px) {
    #portal-announcement {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;

        width: 100%;
        max-height: 28vh;
        padding: 12px 14px 10px;
        border-radius: 18px 18px 0 0;

        font-size: 13px;
    }

    #portal-announcement .pa-title {
        font-size: 12px;
    }
}
