/* ===== 基础变量 ===== */
:root {
    --hue: 239;
    --first-color: hsl(var(--hue), 74%, 66%);
    --first-color-alt: hsl(var(--hue), 74%, 58%);
    --title-color: hsl(var(--hue), 30%, 15%);
    --text-color: hsl(var(--hue), 15%, 45%);
    --text-color-light: hsl(var(--hue), 12%, 65%);
    --body-color: hsl(var(--hue), 60%, 99%);
    --container-color: #fff;
    --border-color: hsl(var(--hue), 20%, 92%);
    --shadow-color: hsla(var(--hue), 30%, 20%, 0.1);

    --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    --big-font-size: 3rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.75rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: 0.875rem;
    --smaller-font-size: 0.813rem;

    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    --header-height: 4rem;
    --transition: 0.3s ease;
    --radius: 1rem;
    --radius-sm: 0.5rem;
}

/* ===== 重置与基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    background-color: var(--body-color);
    color: var(--text-color);
    line-height: 1.7;
}

h1, h2, h3 {
    color: var(--title-color);
    font-weight: var(--font-semibold);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== 通用类 ===== */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

.section {
    padding: 6rem 0 3rem;
}

.section__title {
    font-size: var(--h2-font-size);
    text-align: center;
    margin-bottom: 0.5rem;
}

.section__subtitle {
    display: block;
    text-align: center;
    color: var(--first-color);
    font-size: var(--small-font-size);
    font-weight: var(--font-medium);
    margin-bottom: 3rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: var(--font-medium);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: var(--normal-font-size);
}

.button--primary {
    background-color: var(--first-color);
    color: #fff;
}

.button--primary:hover {
    background-color: var(--first-color-alt);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px hsla(var(--hue), 74%, 66%, 0.3);
}

.button--ghost {
    background-color: transparent;
    color: var(--first-color);
    border: 2px solid var(--first-color);
}

.button--ghost:hover {
    background-color: var(--first-color);
    color: #fff;
}

.button--small {
    padding: 0.625rem 1.25rem;
    font-size: var(--small-font-size);
}

.button--full {
    width: 100%;
}

/* ===== 头部导航 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 1px 4px var(--shadow-color);
    transition: var(--transition);
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    font-size: 1.5rem;
    font-weight: var(--font-bold);
    color: var(--first-color);
    letter-spacing: -1px;
}

.nav__list {
    display: flex;
    gap: 2.5rem;
}

.nav__link {
    font-size: var(--normal-font-size);
    font-weight: var(--font-medium);
    color: var(--title-color);
    position: relative;
    transition: var(--transition);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--first-color);
    transition: var(--transition);
}

.nav__link:hover,
.nav__link.active {
    color: var(--first-color);
}

.nav__link:hover::after,
.nav__link.active::after {
    width: 100%;
}

.nav__toggle,
.nav__close {
    display: none;
}

/* ===== 首页 ===== */
.home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
}

.home__container {
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.home__greeting {
    display: block;
    color: var(--text-color-light);
    font-size: var(--normal-font-size);
    margin-bottom: 0.5rem;
}

.home__title {
    font-size: var(--big-font-size);
    margin-bottom: 0.5rem;
}

.home__subtitle {
    font-size: var(--h3-font-size);
    color: var(--first-color);
    margin-bottom: 1.5rem;
    font-weight: var(--font-medium);
    min-height: 2rem;
}

.home__description {
    color: var(--text-color);
    margin-bottom: 2rem;
    max-width: 400px;
}

.home__buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.home__social {
    display: flex;
    gap: 1rem;
}

.home__social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--title-color);
    background-color: var(--container-color);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.home__social-link:hover {
    background-color: var(--first-color);
    color: #fff;
    border-color: var(--first-color);
    transform: translateY(-3px);
}

.home__blob {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

.home__blob svg {
    width: 100%;
    height: 100%;
}

.home__avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: var(--font-bold);
    color: #fff;
    letter-spacing: -3px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.home__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color-light);
    font-size: var(--smaller-font-size);
    animation: bounce 2s infinite;
}

.home__scroll-icon {
    width: 20px;
    height: 30px;
    border: 2px solid var(--text-color-light);
    border-radius: 10px;
    position: relative;
}

.home__scroll-icon::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--text-color-light);
    border-radius: 50%;
    animation: scroll-dot 2s infinite;
}

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

@keyframes scroll-dot {
    0% { opacity: 1; top: 6px; }
    100% { opacity: 0; top: 18px; }
}

/* ===== 关于我 ===== */
.about__container {
    grid-template-columns: 0.4fr 0.6fr;
    align-items: center;
}

.about__placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--h3-font-size);
    font-weight: var(--font-medium);
    box-shadow: 0 20px 40px hsla(var(--hue), 74%, 66%, 0.25);
}

.about__title {
    font-size: var(--h3-font-size);
    margin-bottom: 1rem;
}

.about__description {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about__info {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.about__box {
    text-align: center;
}

.about__number {
    display: block;
    font-size: var(--h2-font-size);
    font-weight: var(--font-bold);
    color: var(--first-color);
}

.about__label {
    font-size: var(--small-font-size);
    color: var(--text-color-light);
}

/* ===== 技能 ===== */
.skills__container {
    grid-template-columns: repeat(3, 1fr);
}

.skills__card {
    background-color: var(--container-color);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skills__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: transparent;
}

.skills__icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background-color: hsla(var(--hue), 74%, 66%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--first-color);
    margin-bottom: 1.25rem;
}

.skills__title {
    font-size: var(--h3-font-size);
    margin-bottom: 1rem;
}

.skills__list li {
    padding: 0.5rem 0;
    color: var(--text-color);
    font-size: var(--small-font-size);
    border-bottom: 1px solid var(--border-color);
}

.skills__list li:last-child {
    border-bottom: none;
}

/* ===== 项目 ===== */
.projects__container {
    grid-template-columns: repeat(3, 1fr);
}

.project__card {
    background-color: var(--container-color);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.project__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.project__img {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: var(--font-medium);
    transition: var(--transition);
}

.project__card:hover .project__placeholder {
    transform: scale(1.05);
}

.project__content {
    padding: 1.5rem;
}

.project__tag {
    display: inline-block;
    font-size: var(--smaller-font-size);
    color: var(--first-color);
    background-color: hsla(var(--hue), 74%, 66%, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.project__title {
    font-size: var(--h3-font-size);
    margin-bottom: 0.75rem;
}

.project__description {
    font-size: var(--small-font-size);
    color: var(--text-color);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.project__buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color);
    font-size: var(--small-font-size);
    font-weight: var(--font-medium);
    transition: var(--transition);
}

.project__link:hover {
    color: var(--first-color);
}

/* ===== 联系 ===== */
.contact__container {
    grid-template-columns: 0.4fr 0.6fr;
    gap: 4rem;
}

.contact__title {
    font-size: var(--h3-font-size);
    margin-bottom: 1rem;
}

.contact__description {
    margin-bottom: 2rem;
}

.contact__details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact__item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact__icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: hsla(var(--hue), 74%, 66%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--first-color);
}

.contact__item .contact__label {
    display: block;
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
    margin-bottom: 0.1rem;
}

.contact__text {
    color: var(--title-color);
    font-weight: var(--font-medium);
    transition: var(--transition);
}

.contact__text:hover {
    color: var(--first-color);
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact__group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact__label {
    font-size: var(--small-font-size);
    font-weight: var(--font-medium);
    color: var(--title-color);
}

.contact__input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--container-color);
    color: var(--title-color);
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
    transition: var(--transition);
    outline: none;
}

.contact__input:focus {
    border-color: var(--first-color);
    box-shadow: 0 0 0 3px hsla(var(--hue), 74%, 66%, 0.1);
}

.contact__textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== 页脚 ===== */
.footer {
    background-color: var(--title-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer__logo {
    font-size: 1.75rem;
    font-weight: var(--font-bold);
    color: var(--first-color);
}

.footer__copy {
    color: var(--text-color-light);
    font-size: var(--small-font-size);
}

.footer__social {
    display: flex;
    gap: 1rem;
}

.footer__social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    background-color: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.footer__social-link:hover {
    background-color: var(--first-color);
    color: #fff;
    transform: translateY(-3px);
}

/* ===== 响应式 ===== */
@media screen and (max-width: 992px) {
    .home__container,
    .about__container,
    .contact__container {
        grid-template-columns: 1fr;
    }

    .home__content {
        order: 2;
        text-align: center;
    }

    .home__description {
        margin-left: auto;
        margin-right: auto;
    }

    .home__buttons,
    .home__social {
        justify-content: center;
    }

    .home__img {
        order: 1;
    }

    .about__img {
        max-width: 350px;
        margin: 0 auto;
    }

    .about__content {
        text-align: center;
    }

    .about__info {
        justify-content: center;
    }

    .skills__container,
    .projects__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    :root {
        --big-font-size: 2.5rem;
        --h1-font-size: 1.75rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.125rem;
    }

    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--container-color);
        box-shadow: -2px 0 10px var(--shadow-color);
        padding: 6rem 2rem 0;
        transition: var(--transition);
        z-index: 1001;
    }

    .nav__menu.show-menu {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 2rem;
    }

    .nav__link {
        font-size: var(--h3-font-size);
    }

    .nav__toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1002;
    }

    .nav__toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--title-color);
        transition: var(--transition);
    }

    .nav__close {
        display: flex;
        flex-direction: column;
        gap: 5px;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        cursor: pointer;
    }

    .nav__close span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--title-color);
    }

    .nav__close span:first-child {
        transform: rotate(45deg) translate(2px, 2px);
    }

    .nav__close span:last-child {
        transform: rotate(-45deg) translate(2px, -2px);
    }

    .home__blob {
        width: 260px;
        height: 260px;
    }

    .home__avatar {
        font-size: 3rem;
    }

    .skills__container,
    .projects__container {
        grid-template-columns: 1fr;
    }

    .contact__container {
        gap: 2rem;
    }

    .contact__info {
        text-align: center;
    }

    .contact__details {
        align-items: center;
    }
}

@media screen and (max-width: 350px) {
    .container {
        padding: 0 1rem;
    }

    .home__buttons {
        flex-direction: column;
    }

    .home__blob {
        width: 220px;
        height: 220px;
    }
}
