/* 引入自定义字体 - 根据用户要求，这里使用 @import */
/* 尽管在性能上 <link> 标签通常更优，但此处遵循用户指定的方式 [9, 10] */
/* @import url("https://static.zeoseven.com/zsft/288/main/result.css"); */
/* 注意：由于用户已在HTML <style> 标签中指定了 @import，此处不再重复 */

/* 全局重置与基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%; /* 确保html和body占据整个视口高度 */
    font-family: 'Noto Serif CJK', sans-serif; /* 使用导入的字体，并提供备用字体 */
    line-height: 1.6;
    color: #333; /* 深色文本，高对比度 [11] */
    background-color: #f8f8f8; /* 浅色背景，增加留白感 [12] */
}

/* 整体布局容器：使用CSS Grid */
.wrapper {
    display: grid;
    min-height: 100vh; /* 确保容器至少占据整个视口高度 */
    grid-template-rows: auto 1fr auto; /* header, content area (main+sidebar), footer */
    grid-template-columns: 1fr; /* Default single column for mobile */
    grid-template-areas:
        "header"
        "main-area" /* Combined main and sidebar for mobile */
        "footer";
    gap: 20px; /* 各区域之间的间距 */
    max-width: 1200px; /* 限制内容最大宽度 */
    margin: 0 auto; /* 居中显示 */
    padding: 20px; /* 整体内边距 */
}

/* 头部样式 */
.site-header {
    grid-area: header;
    background-color: #ffffff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.site-header h1 {
    font-size: 2em;
    color: #222;
    margin: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: #007bff; /* 强调色 */
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #0056b3;
}

/* 侧边栏样式 */
.sidebar {
    grid-area: sidebar; /* This will be assigned in media queries for larger screens */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* On mobile, sidebar will be part of main-area, so it needs to be styled differently */
    display: none; /* Hide by default on mobile, show on larger screens */
}

.sidebar h2 {
    font-size: 1.5em;
    color: #222;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar a:hover {
    background-color: #e9ecef;
    color: #007bff;
}

/* 主体内容区域 */
.main-content {
    grid-area: main-area; /* For mobile, it's the main content area */
    padding: 40px 20px; /* 内部留白 */
    background-color: #ffffff; /* 白色背景，突出内容 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* 轻微阴影增加层次感 */
    border-radius: 8px; /* 圆角 */
    /* margin-bottom: 20px; /* Removed as footer is now part of grid */
}

/* 板块样式 */
.section-block {
    margin-bottom: 60px; /* 板块之间更大的间距，增加留白感 [12] */
    padding-bottom: 30px;
    border-bottom: 1px solid #eee; /* 轻微分隔线 */
}

.section-block:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
}

h2 {
    font-size: 2.2em;
    color: #222;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 1px;
    padding-bottom: 15px;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #007bff; /* 强调色 */
    border-radius: 2px;
}

/* 可点击网站链接网格布局 */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 响应式网格布局 [5] */
    gap: 25px; /* 链接项之间的间距 */
}

.link-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #f0f0f0; /* 链接项背景色 */
    border-radius: 6px;
    text-decoration: none; /* 默认无下划线 [13] */
    color: #333;
    transition: all 0.3s ease; /* 平滑过渡效果 */
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
    min-height: 100px; /* 确保点击区域足够大 [13] */
    justify-content: center;
}

.link-item:hover {
    background-color: #e6e6e6; /* 悬停时背景变浅 [13] */
    color: #007bff; /* 悬停时文本变蓝，作为强调色 [11] */
    transform: translateY(-3px); /* 轻微上浮效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.link-item:focus {
    outline: 2px solid #007bff; /* 键盘焦点状态 [11] */
    outline-offset: 2px;
}

.link-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    color: inherit; /* 继承父元素的颜色 */
}

.link-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* 页脚样式 */
.site-footer {
    grid-area: footer;
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 0.9em;
    background-color: #ffffff; /* 与main区域背景色一致，视觉上合并 */
    border-top: 1px solid #eee; /* 轻微分隔线 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03); /* 轻微阴影 */
}

.site-footer p {
    margin-bottom: 5px;
}

.site-footer a {
    color: #007bff; /* 页脚链接使用强调色 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 主页按钮样式（页脚） - 默认在桌面隐藏，仅在移动端显示 */
.site-footer .home-button {
    display: none; /* 默认隐藏，移动端通过媒体查询显示 */
    margin-top: 8px;
    padding: 8px 14px;
    background-color: #007bff;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.site-footer .home-button:hover {
    background-color: #0056b3;
}

/* 响应式调整 */
/* Tablet and larger screens */
@media (min-width: 768px) {
   .wrapper {
        grid-template-columns: 250px 1fr; /* Sidebar width, Main content width */
        grid-template-areas:
            "header header"
            "sidebar main-area"
            "footer footer";
    }

   .sidebar {
        display: block; /* Show sidebar on larger screens */
    }

   .main-content {
        padding: 40px; /* Adjust padding for larger screens */
    }

   .site-header {
        flex-wrap: nowrap; /* Prevent header items from wrapping */
    }
}

/* Desktop and larger screens */
@media (min-width: 1024px) {
   .wrapper {
        grid-template-columns: 280px 1fr; /* Slightly wider sidebar */
        gap: 30px; /* Larger gap */
    }

   .main-content {
        padding: 50px;
    }

   .site-header h1 {
        font-size: 2.5em;
    }
}

/* Mobile specific adjustments */
@media (max-width: 767px) {
   .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }

   .site-header h1 {
        margin-bottom: 15px;
        /* 移动端让 BI9CBD 居中 */
        align-self: center;
        text-align: center;
        width: 100%;
    }

   /* 在移动端将主导航放为一行，允许横向滚动以避免换行导致布局错位，并整体居中 */
   .main-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

   .main-nav ul {
        display: flex;
        flex-direction: row;
        gap: 10px;
        white-space: nowrap;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center; /* 新增：整体居中 */
        padding: 6px 8px; /* 少量内边距，避免紧贴边缘 */
    }

   .main-nav a {
        display: inline-block;
        padding: 8px 10px;
    }

   .main-content {
        padding: 30px 15px;
    }

    h2 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

   .link-grid {
        grid-template-columns: 1fr; /* Small screens: single column for links */
    }

   .section-block {
        margin-bottom: 40px;
    }

   /* 在移动端显示页脚返回主页按钮 */
   .site-footer .home-button {
        display: inline-block;
   }
}

@media (max-width: 480px) {
   .wrapper {
        padding: 15px;
        gap: 15px;
    }

   .main-content {
        padding: 20px 10px;
    }

    h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

   .link-item {
        padding: 15px;
    }
}
