@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

html, body {
    height: 100vh; /* Set height to 100% of the viewport height */
    overflow: hidden; /* Prevent scrolling */
}

body {
    display: flex;
    flex-direction: column;
}

/* Main Content */
/* 1. 将 main-content 变为网格容器 */
.main-content {
    flex-grow: 1;
    display: grid; /* <-- 关键改动：使用 Grid 布局 */

    /* 2. 定义两列：每一列都占据 50% 的宽度 */
    grid-template-columns: 50% 50%;

    /* 3. 确保容器有高度，以便进行垂直对齐 */
    align-items: stretch;

    /* 4. 为页面整体添加留白 */
    padding: 8rem 4rem; /* 例如：上下8rem, 左右4rem */
    box-sizing: border-box; /* 确保 padding 不会影响总宽度计算 */
}

/* 2. 将左侧内容放置在第一列 */
.about-left {
    grid-column: 1; /* <-- 放置在第 1 个网格列 */
    align-self: end; /* 垂直方向：靠下对齐 */

    /* 可选：控制内容在本列中的最大宽度 */
    max-width: 600px;
    padding: 0 5rem;
}

/* 3. 将右侧内容放置在第二列 */
.about-right {
    grid-column: 2; /* <-- 放置在第 2 个网格列 */
    align-self: start; /* 垂直方向：靠上对齐 */

    /* 可选：控制内容在本列中的最大宽度 */
    max-width: 500px;
}


.vertical-title{
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-orientation: mixed;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom:  2rem;
}

.about-left p{
    font-size: 1rem;
    line-height: 1.8;
}

.about-right p{
    font-size: 1.1rem;
    line-height: 1.6;
}

.about-right .email {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2rem 0;
}

.resume-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
    transition: color 0.3s ease-in-out;
    text-decoration: none; /* 取消整个链接的下划线 */
}

.resume-link .link-text {
    text-decoration: underline; /* 只给文字加下划线 */
}

.resume-link:hover {
    color: var(--primary-color);
}


/* Responsive Design Adjustments */
/* ============================================== */
/* 响应式布局 (移动端)
/* ============================================== */
@media (max-width: 768px) {

    html, body {
        height: auto;       /* 1. 允许页面高度根据内容自适应增长 */
        overflow-y: auto;   /* 2. 只在垂直方向内容溢出时，自动显示滚动条 */
    }

    /* 1. 将布局模式从 Grid 切换回 Flexbox，以实现简单的垂直堆叠 */
    .main-content {
        display: flex;
        flex-direction: column;

        /* 覆盖掉桌面端的 grid-template-columns */
        grid-template-columns: none;

        /* 水平居中堆叠后的项目 */
        align-items: center;

        /* 使用适合移动端的内边距和间距 */
        padding: 4rem 2rem;
        gap: 3rem;
    }

    /* 2. 重置子元素在桌面端 Grid 布局中的设置 */
    .about-left,
    .about-right {
        /* 重置网格列的分配 */
        grid-column: auto;
        /* 重置对角线对齐 */
        align-self: auto;
        /* （可选）让内容文本居中 */
        text-align: center;
    }

    /* 3. 重新使用 order 属性，让右侧内容显示在上方 */
    .about-right {
        order: 1;
        padding: 5rem 0 2rem 0;
    }
    .about-left {
        order: 2;
        padding: 0 7% 5rem 7%;
    }

    /* 4.（可选）让垂直标题在移动端变为水平，方便阅读 */
    .vertical-title {
        writing-mode: horizontal-tb;
        transform: none;
        margin-bottom: 1.5rem;
        font-size: 2rem;
        font-weight: 600;
    }
}