/* 变量 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-color: #f9f9f9;
    --text-color: #333;
    --card-background: #fff;
}

/* keyframes */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes wave {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes hitokotofadeIn {
    0% { opacity: 0; }
    25% { opacity: 0.25; }
    50% { opacity: 0.65; }
    75% { opacity: 0.85; }
    85% { opacity: 0.90; }
    92% { opacity: 0.95; }
    100% { opacity: 1; }
}

/* 页面加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* 页面加载完成后淡出动画 */
@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* base */

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

body {
    width: 100vw;
    height: 100vh;
    overflow-x: hidden; /* 禁用横向滑动 */
    font-family: Ginto,ui-sans-serif,system-ui,"Apple Color Emoji",
    "Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji",Arial, Helvetica, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 滚动条处理 (尝试性) */
html {
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-color: #888 transparent; /* 滑块颜色, 轨道颜色 */
}

html::-webkit-scrollbar {
    width: 0; /* Webkit */
    height: 0; /* Webkit */
}

/* 加载动画样式 */
.loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 4em;
    height: 4em;
    border: 0.3em solid var(--background-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-wrapper.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

/* .page-content 的过渡效果 */
.page-content {
    transition: opacity 0.5s ease;
}

/* layout */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    clip-path: ellipse(100% 80% at 50% 20%);
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 8vh 22vw 12vh;
    animation: fadeInUp 3s ease forwards;
    opacity: 0;
    transform: translateY(-20px);
    height: 65vh; /* 占据视口的65%高度 */
}

.avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto 2vh;
    overflow: hidden;
    border-radius: 5em;
    border: 0.13em solid #fff;
    box-shadow: 0 0.6em 1.5em rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    font-size: 5vh;
    margin-bottom: 1vh;
    color: #fff;
    transition: all 0.8s ease;
}

.tagline {
    font-size: 2.5vh;
    color: rgba(255, 255, 255, 0.9); /* 略微透明的白色，以增加对比 */
    transition: all 0.8s ease;
}

.links {
    display: flex;
    justify-content: center;
    gap: 1.5vw;
    margin-top: 1vw;
    transition: all 0.8s ease;
}

.link-item {
    font-size: 4vh;
    color: #fff;
    transition: color 0.5s ease;
}

.link-item:hover {
    color: #ffcc00;
}

.intro, .projects, .sub-sites, .links {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: 0.8s ease 0s 1 normal forwards running fadeInUp;
}
.intro {
    position: relative;
    margin-top: -15vh; /* 使 intro-card 与 header 部分重叠 15%*/
    height: 50vh; /* 占据视口的一半高度 */
}

.intro p {
    font-size: 1.2rem;
    /* max-width: 65vw; */
    margin: 0 auto;
    text-align: center;
    transition: all 1.2s ease;
}

.intro-card {
    width: 100vw; /* 使卡片宽度与视口宽度一致 */
    margin-left: calc(50% - 50vw); /* 确保卡片从浏览器左边缘开始 */
    background-color: var(--card-background);
    padding: 22vh 5vh;
    border-radius: 6vh;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 使内容在卡片内垂直居中 */
    height: 100%; /* 使卡片高度充满 intro */
}

.skills {
    margin-top: 7vh;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2vh;
}

.skill-item {
    background: linear-gradient(135deg, #3498db, #2980CE);
    color: #fff;
    padding: 1.5vh 1.5vw;
    border-radius: 1.5em;
    font-size: 1em;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.skill-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.skill-text {
    position: relative;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.skill-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.3) 100%);
    background-size: 200% 100%;
    animation: wave 4s linear infinite;
    position: relative;
    overflow: hidden;
}

.skill-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    color: #fff;
}

.skill-item.active .skill-text {
    opacity: 0;
}

.skill-item.active .skill-progress,
.skill-item.active .skill-percentage {
    opacity: 1;
}

.scroll-down {
    position: absolute;
    bottom: 5px;
    transform: translateX(-50%);
    left: calc(50% - 0.6rem);
    font-size: 1.2rem;
    color: var(--primary-color);
    animation: bounce 2.5s infinite;
    display: none; /* 默认隐藏 */
    pointer-events: none;/* 无需任何效果 */
    z-index: -10;
}

.projects h2, .sub-sites h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.project-grid, .site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.project-card, .site-card {
    text-align: center;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.6s ease-out;
}

.project-card.animate, .site-card.animate {
    opacity: 1;
    transform: translateY(0px);
}

.project-card:hover, .site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.site-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.site-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

footer {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.footer-content {
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--secondary-color) 0%, var(--primary-color) 70%);
    animation: rotate 20s linear infinite;
    opacity: 0.3;
}

.Copyright {
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.sentence {
    font-size: 0.8rem;
}

.hitokoto {
    animation: hitokotofadeIn cubic-bezier(0.55, 0.085, 0.68, 0.53) 3s;
    opacity: 1;
}

.beian {
    font-size: 0.6rem;
    display: flex;
    justify-content: center;
    gap: 1.5vw;
}

.filing-itme img{
    width: 0.5rem;
    height: 0.5rem;
}

.beian a {
    text-decoration: none;
    color: #fff;
}

/* responsive */

@media (max-width: 1110px) {
    .intro p {
        max-width: 86vw; 
        font-size: 1.1rem;
        margin: calc(32.5vh - 2.2rem) auto;
    }

    .skill-item {
        display: none;
    }

    .project-grid, .site-grid {
        grid-template-columns: 1fr; /* 单列布局 */
    }

    .name {
        font-size: 2rem; /* 调整字体大小 */
    }

    .tagline {
        font-size: 1rem; /* 调整字体大小 */
    }

    .intro-secondary {
        display: none;
    }

    .intro-card{
        padding: 0!important;
    }

    .scroll-down {
        display: block; /* 小屏幕上显示 */
    }
}

@media (max-height: 500px) {
    .name, .tagline{
        font-size: 0.1px !important;
        opacity: 0;
    }

    .intro p {
        max-width: 86vw; 
        font-size: 1.1rem;
        margin: calc(32.5vh - 2.2rem) auto;
    }

    .skill-item {
        display: none;
    }

    .project-grid, .site-grid {
        grid-template-columns: 1fr; /* 单列布局 */
    }

    .name {
        font-size: 2rem; /* 调整字体大小 */
    }

    .tagline {
        font-size: 1rem; /* 调整字体大小 */
    }

    .intro-secondary {
        display: none;
    }

    .intro-card{
        padding: 0!important;
    }

    .scroll-down {
        display: block; /* 小屏幕上显示 */
    }

}


@media (max-height: 315px) {
    .links {
        display: none;
    }
}

@media (max-height: 295px) {
    .avatar {
        width: 120px;
        height: 120px;
    }

}

@media (max-height: 230px) {
    .avatar {
        width: 90px;
        height: 90px;
    }
}

@media (max-height: 170px) {
    .intro p {
        display: none;
    }
}

