.logo {
    display: inline-block;
    font-family: 'Noto Serif TC', serif;
    font-weight: 700;
    font-size: 42px;       /* 与原 SVG 标题字大小一致 */
    line-height: 50px;     /* 保持原图 50px 的占位高度，位置不变 */
    color: black;
    white-space: nowrap;
    margin-left: 15%;
    margin-top: 10vw;   /* 按视口宽算，不受容器宽度影响，各段间距统一 */
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: black;
    }
    .logo {
        filter: invert(1);
    }
    .linkbutton {
        background-color: white;
        color: black;
    }
    .button {
        filter: invert(1);
    }
    p {
        filter: invert(1);
    }
    .exp {
        filter: invert(1);
    }
    .page-number {
        filter: invert(1);
    }
    .lang-switch {
        filter: invert(1);
    }
    .linkbox {
        filter: invert(1);
    }
    .img {
        filter: invert(1);
    }
}

/* 移动端布局 */
@media screen and (max-aspect-ratio: 1) {
    .logo {
        font-size: 38px;
        line-height: 45px;
        margin-left: 15%;
        margin-top: 50%;
    }
    .button {
        margin-top: 0%;
        margin-left: 20%;
    }
}

/* 反人类的窄屏 */
@media screen and (max-aspect-ratio: 0.4) {
    .logo {
        margin-left: 0;
    }
    .button{
        margin-top: 0;
        margin-left: 0;
    }
}

.linkbutton {
    /* 白色方块高亮：像文字一样随行流动，可跨两行断开 */
    display: inline;
    background-color: black;
    color: white;
    border: 0;
    padding: 0 0.15em;
    cursor: pointer;
    font-family: 'Noto Serif TC', serif;
    font-size: 15px;
    /* 换行后每一行的方块背景都正常绘制 */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.button{
    background-color: transparent;
    border-style: solid;
    border-color: black;
    color: black;
    height: 30px;
    width: 200px;
    border-radius: 0%;
    border-width: 2px;
    margin-top: 20px;
    margin-left: 15%;
    font-family: 'Noto Serif TC', serif;
    text-align: left;
    transition: all 1s;
}

.button:hover {
    color: white;
    background-color: black;
}

p {
    color: black;
    margin-left: 20%;
    width: 270px;
    font-family: 'Noto Serif TC', serif;
}

/* Experience 经历列表（仅英文） */
.exp {
    margin-left: 15%;
    width: 70%;
    max-width: 560px;
    margin-top: 10px;
    color: black;
    font-family: 'Noto Serif TC', serif;
}
.exp-item {
    margin-top: 24px;
}
.exp-role {
    font-weight: 700;
    font-size: 18px;
}
.exp-meta {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 2px;
}
.exp-desc {
    font-size: 15px;
    line-height: 1.5;
    margin-top: 6px;
}

/* 默认显示英文，中文版隐藏，点切换按钮再显示 */
.lang-zh {
    display: none;
}

/* 英文正文：左对齐（空格正常），单词放不下时用 - 断词换行 */
.lang-en p {
    text-align: left;
    width: 380px;          /* 英文版每行更长，中文仍用默认 270px */
    -webkit-hyphens: auto;
    hyphens: auto;
}

html::-webkit-scrollbar { /* 隐藏滚动条 */
    width: 0px; 
}

.page-number {
    font-family: 'Noto Serif TC', serif;
    text-align: center;
    color: black;
    font-size: 15px;
    position: fixed;
    top: 20px;
    right: 90px;
    width: 10%;
    min-width: 50px;
    max-width: 100px;
    border: 2px solid black;
    padding: 2px;
    background-color: white;
    transition: color 1s;
    transition: background-color 1s;
}

.page-number:hover {
    color: white;
    background-color: black;
}

.lang-switch {
    font-family: 'Noto Serif TC', serif;
    text-align: center;
    color: black;
    font-size: 15px;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    border: 2px solid black;
    padding: 2px;
    background-color: white;
    cursor: pointer;
    z-index: 101;
    transition: color 1s, background-color 1s;
}

.lang-switch:hover {
    color: white;
    background-color: black;
}

.linkbox{
    background-color: transparent;
    border-style: solid;
    border-color: black;
    color: black;
    height: 125px;
    width: 200px;
    border-radius: 0%;
    border-width: 2px;
    margin-top: 20px;
    margin-right: 20px;
    padding-left: 14px;
    font-family: 'Noto Serif TC', serif;
    text-align: left;
    transition: all 1s;
}

.linkbox:hover {
    color: white;
    background-color: black;
}

.img {
    max-height: 50px;
    min-height: 50px;
}

#toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: black;
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    font-family: 'Noto Serif TC', serif;
    font-size: 15px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#toast.show {
    opacity: 1;
    visibility: visible;
}

.site-footer {
    text-align: center;
    color: black;
    font-family: 'Noto Serif TC', serif;
    font-size: 14px;
    padding: 40px 0 20px;
}

.site-footer a {
    color: black;
}

@media (prefers-color-scheme: dark) {
    .site-footer {
        color: white;
    }
    .site-footer a {
        color: white;
    }
}

#threejs-cross {
    position: fixed;
    top: 50%;
    right: 5%;
    width: min(500px, 40vw);
    height: min(500px, 40vw);
    max-height: 80vh;
    z-index: 10;
    pointer-events: auto;
    display: block;
    transform: translateY(-50%);
}
/* 让 3D 画布跟着容器一起缩放，窗口变小时猫也变小 */
#threejs-cross canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
@media screen and (max-width: 768px) {
    #threejs-cross {
        display: none;
    }
}

