/* 重置盒模型 + 基础安全边距 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    background-color: rgb(230, 230, 230);
}

/* 主内容区默认内边距（移动优先） */
.main-section {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: #297d7a;
    font-family: Segoe UI Bold;
}

/* ===== 导航栏响应式 ===== */
.navbar-mid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.logo img {
    max-width: 120px;
    height: auto;
    display: block;
}

/* 菜单容器 */
.nav-li {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-li-item a {
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 0;
    display: inline-block;
}

/* 汉堡按钮（桌面端隐藏） */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 6px 8px;
    user-select: none;
    background: none;
    border: none;
}
.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: 0.3s;
}

/* 隐藏 checkbox（控制菜单显隐） */
#menu-toggle {
    display: none;
}

/* 主题切换按钮保持舒适点击区 */
.theme-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ===== 内容区响应式 ===== */

/* Chuck 左右布局 */
#chuck-icon {
    font-family: Nabla;
    font-size: 10em;
}

.chuck {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
    margin: 5rem 0;
    /* text-align: center;
    vertical-align: middle; */
}

.chuck-img {
    flex: 1 1 120px;
    text-align: center;
}

.chuck-img p {
    text-align: center;
}

.chuck-recommend {
    flex: 3 1 260px;
}

.chuck-recommend-item {
    margin-bottom: 1.5rem;
}

.chuck-recommend-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.chuck-recommend-description {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.4;
}

/* Project 区域（响应式网格） */
.project {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin: 5rem 0;
}

.pj-recommend {
    background: transparent;
    transition: transform 0.2s ease;
}

.pj-img {
    width: 100%;
    /* max-width: 100%; */
    /* height: 100%; */
    border-radius: 12px;
    object-fit: cover;
    /* aspect-ratio: 16 / 9; */
    display: block;
    /* margin-bottom: 0.75rem; */
}

.pj-name {
    margin-bottom: 0;
}

.pj-name a {
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.pj-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0;
}

/* Pvort 列表区域 */
.pvort {
    margin: 5rem 0;
}

.pvort-recommend {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pvort-recommend a {
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.pvort-recommend p {
    margin: 0;
    line-height: 1.5;
}

/* 底部链接行 */
.backLink {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
}

.backLink p {
    margin: 0;
}

.backLink a {
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: inline-block;
    min-width: 100px;
    text-align: center;
    color: #297d7a;
    font-weight: bold;
}

/* ===== 页脚自适应 ===== */
.footerbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #626262;
    color: #DEDEDE;
}

.beian-left,
.beian-middle,
.beian-right {
    display: inline-block;
}

.beian-left a,
.beian-middle a,
.beian-right a {
    color: #1db1ac;
    font-weight: bold;
}

/* 公共链接样式 */
a {
    text-decoration: none;
    color: #297d7a;
    font-family: 'Segoe UI Bold';
    font-weight: bold;
}

a.hypertext-link {
    text-decoration: none;
    color: #297d7a;
    font-family: 'Segoe UI Bold';
}

hr {
    max-width: 90%;
    margin: 1.5rem auto;
}

/* ========== 移动端（≤768px） ========== */
@media (max-width: 768px) {
    /* 导航栏：logo + 汉堡 + 菜单 */
    .navbar-mid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    .logo {
        flex: 0 0 auto;
    }

    .hamburger {
        display: flex;
        order: 2;
    }

    .nav-li {
        flex: 0 0 100%;
        order: 3;
        display: none;
        justify-content: center;
    }

    /* 选中时显示菜单 */
    #menu-toggle:checked ~ .navbar-mid .nav-li {
        display: flex;
    }

    .nav-ul {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
        width: 100%;
        padding: 0.5rem 0;
    }

    .settings {
        order: 1;
        align-self: center;
    }

    /* Chuck 垂直排列 */
    .chuck {
        flex-direction: column;
        gap: 1rem;
    }

    .chuck-img {
        text-align: center;
    }

    /* 网格自动变成单列 */
    .project {
        gap: 1.5rem;
        /* text-align: center; */
    }

    .pj-recommend {
        width: 75%;
    }

    /* 页脚竖向排列 */
    .footerbar {
        flex-direction: column;
        justify-content: center;
    }

    .backLink {
        gap: 1rem;
    }

    body {
        font-size: 15px;
    }

    .main-section {
        padding: 0.75rem;
    }

    hr {
        width: 40% !important;
    }

    /* 汉堡动画（点击后变 X） */
    #menu-toggle:checked ~ .navbar-mid .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    #menu-toggle:checked ~ .navbar-mid .hamburger span:nth-child(2) {
        opacity: 0;
    }
    #menu-toggle:checked ~ .navbar-mid .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ========== 小型手机（≤480px） ========== */
@media (max-width: 480px) {
    .main-section {
        padding: 0.5rem;
    }

    .chuck-recommend-title {
        font-size: 1.1rem;
    }

    .pj-name a {
        font-size: 1.1rem;
    }

    .footerbar {
        font-size: 0.75rem;
    }
}

/* ========== 大屏舒适居中宽度 ========== */
@media (min-width: 1400px) {
    .main-section {
        padding: 1rem 2rem;
    }
}

/* 可触摸元素优化（符合 WCAG 建议） */
a,
button,
.theme-toggle,
.backLink a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 保留原有暗色模式兼容 */
[data-theme="dark"] .pvort-recommend {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}