/* 引入字体 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "DM Sans", sans-serif;
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    text-transform: uppercase;
    font-size: 6rem;
    font-weight: 600;
    line-height: 1;
}

p {
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
}

/* 覆盖层基础样式 */
.preloader, .split-overlay, .tags-overlay {
    position: fixed;
    width: 100vw;
    height: 100svh;
}

.preloader, .split-overlay {
    background-color: #000;
    color: #fff;
}

.preloader, .tags-overlay {
    z-index: 2;
}

.split-overlay {
    z-index: 1;
}

/* 标题定位 */
.intro-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

.outro-title {
    position: absolute;
    top: 50%;
    left: calc(50% + 10rem); /* 修正 calc 空格 */
    transform: translate(-50%, -50%);
}

/* 标签样式 */
.tag {
    position: absolute;
    width: max-content;
    color: #5a5a5a;
    overflow: hidden;
}

.tag-1 {
    top: 15%;
    left: 15%;
}

.tag-2 {
    bottom: 15%;
    left: 25%;
}

.tag-3 {
    bottom: 30%;
    right: 15%;
}

/* 主容器 */
.container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    clip-path: polygon(0 48%, 0 48%, 0 52%, 0 52%);
    z-index: 2;
}

/* 修正选择器：空格分隔（container 下的 hero-img） */
.container .hero-img {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* 导航和页脚 */
nav, footer {
    position: relative;
    width: 100vw;
    padding: 2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    z-index: 2;
}

nav p#logo {
    font-weight: 600;
    font-size: 20px;
}

/* 卡片样式 */
.card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    clip-path: polygon(0% 50%, 100% 50%, 100% 50%, 0% 50%);
}

.card h1 {
    text-align: center;
    width: 100%;
    font-size: 3rem;
}

/* 修正选择器：空格分隔 */
.card .char span {
    position: relative;
    display: inline-block;
    transform: translateY(100%);
    will-change: transform;
}

.intro-title .char, .outro-title .char, .card .char {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.intro-title .char, .outro-title .char {
    margin-top: 0.75rem;
}

.intro-title .char span, .outro-title .char span, .tag .word {
    position: relative;
    display: inline-block;
    transform: translateY(-100%); /* 初始值 100%，动画到 0% */
    will-change: transform;
}

.intro-title .first-char {
    transform-origin: top left;
}

/* 响应式适配 */
@media (max-width: 1000px) {
    h1 {
        font-size: 2.5rem;
    }
    .outro-title {
        left: calc(50% + 4rem); /* 修正 calc 空格 */
    }
    .card {
        width: 75%;
    }
    .card h1 {
        font-size: 2.5rem;
    }
    .intro-title .char, .outro-title .char {
        margin-top: 0.5rem;
    }
}