/* ======================================================================
   assets/css/common.css — 全站公共样式合集（header + 分页 + footer）
   自上而下：顶栏与壳层 → 分页条 → 页脚；页面样式在各页 *.css。
   ======================================================================
*/
/* 【模块-reset-shell】通配清零、body 排版、--site-header-h 与站内主滚动壳 .site-scroll-shell（与 header.php 配套）。 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width:100%;
    margin:0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-text-size-adjust: none;
    -moz-text-size-adjust: none;
    -ms-text-size-adjust: none;
    text-size-adjust: none;
}

:root {
    --site-header-h: 65px;
    --site-primary: #1d4ed8;
    --site-primary-hover: #1e40af;
    --site-primary-soft: rgba(29, 78, 216, 0.08);
    --site-primary-soft-bg: #eff6ff;
    --site-primary-border: rgba(29, 78, 216, 0.22);
    /* 主内容与页脚之间的统一留白（需求中心/详情、模板下载等对齐） */
    --site-content-bottom-gap: 35px;
    /*
     * 全站内容区最大宽度：顶栏/页脚、demands、template、login、about、help、index 等 max-width 均用 var(--site-max-width)。
     * 注意：CSS 规范下 @media / @container 条件里不能写 var()，故 index.css 等处仍写死 max-width: 1200px；
     *       修改全站内容宽度时请同步检索并替换这些断点字面量。
     */
    --site-max-width: 1200px;
}

@media (max-width: 1024px) {
    :root {
        --site-header-h: 55px;
    }
}

html:has(.site-scroll-shell) {
    height: 100%;
    overflow: hidden;
}

html:has(.site-scroll-shell) body {
    height: 100%;
    overflow: hidden;
}

.site-scroll-shell {
    position: fixed;
    inset: var(--site-header-h) 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

body.menu-open .site-scroll-shell {
    overflow: hidden;
}

body:has(.site-scroll-shell) main {
    margin-top: 0;
}
/* 移动菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between; /* 使菜单项垂直居中 */
    width: 30px;
    height: 21px; /* 统一高度 */
    cursor: pointer;
    z-index: 1001;
    margin-left: 15px; /* 添加间距 */
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 菜单打开时的样式 */
body.menu-open {
    overflow: hidden; /* 防止页面滚动 */
}

/* 菜单过渡效果 */
.main-nav {
    transition: all 0.3s ease-in-out;
    margin-left: auto;
    min-width: 0;
    flex-shrink: 1;
}

.main-nav.active {
    opacity: 1;
    visibility: visible;
}

/* 搜索框过渡效果 - PC模式默认显示 */
.search-box {
    display: flex;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    height: auto;
    overflow: visible;
    gap: 10px;
    transition: all 0.3s ease;
}
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}
ul,li,ol {
    list-style: none;
}
a {
    text-decoration: none;
    outline: none;
    color: #262626;
}

/* 【模块-site-header】固定顶栏容器、投影与 stacking，对应 includes/header.php。 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.header-container {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 0;
}

.logo {
    transition: all 0.3s ease;
    flex-shrink: 0;
    line-height: 0;
}
.logo a {
    display: inline-block;
    line-height: 0;
}
.header-container .logo img {
    height: 65px;
}
.logo img {
    display: block;
    transition: all 0.3s ease;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    transition: all 0.3s ease;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
}

.main-nav a:hover,.main-nav a.active {
    color: #1d4ed8;
    font-weight: 600;
    /*border-bottom: 2px solid #1d4ed8;*/
}

.header-right #searchToggle {
    display: none;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}



.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 150px;
    transition: all 0.3s ease;
}

.search-box button {
    padding: 8px 15px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(29, 78, 216, 0.3);
}

.search-box button:active {
    transform: translateY(0);
    box-shadow: none;
}

.user-actions {
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-login,
.btn-register {
    padding: 6px 15px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 12px;
    text-align: center;
}

.btn-login {
    color: #1d4ed8;
    border: 1px solid #1d4ed8;
}

.btn-register {
    background: #1d4ed8;
    color: #fff;
}

.btn-login:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-register:hover {
    background: #1e40af;
}
/* ====== 已登录用户按钮（和 btn-login / btn-register 对齐） ====== */
.btn-user,
.btn-logout {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-user {
    color: #333;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.btn-user:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.icon-user {
    width: 18px;
    height: 18px;
    fill: #999;
}

.user-nickname {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    color: #666;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.btn-logout:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}

.btn-user svg,
.btn-logout svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.logout-text {
    font-size: 13px;
}
/* 登录/注册按钮图标样式 */
.icon-login,.icon-register {
    width: 30px;
    height: 30px;
    fill: currentColor;
    display: none;
}

/* 主要内容区 */
main {
    margin: 65px auto 0;
}
.section-container {
    max-width: var(--site-max-width);
    margin: 0 auto;
}

/* 面包屑导航 */
.breadcrumb {
  color: #999;
  font-size: 14px;
  padding: 15px 0;
}

/* 平板电脑和中等屏幕的响应式样式 (1024px及以下) */
@media (max-width: 1024px) {
    .main-nav {
        margin-left: 0;
    }

    .header-right {
        margin-left: auto;
    }

    .header-container .logo img {
    height: 55px;
    }
    main {
    margin: 55px auto 0;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0;
        margin: 0;
        gap: 0;
        gap: 15px;
        align-items: center;
    }
    
    .main-nav a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.5;
    }
    
    .search-box {
        opacity: 0;
        visibility: hidden;
        height: 0;
        overflow: hidden;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 10px 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 999;
        display: none;
    }
    
    .search-box.active {
        opacity: 1;
        visibility: visible;
        height: auto;
        display: flex;
    }
    
    
    .search-box input {
        width: 100px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    /* 搜索按钮 */
    .search-toggle {
        display: flex!important;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        background-color: transparent;
        border: none;
        cursor: pointer;
        order: 0; /* 搜索图标放在最前面 */
        border-radius: 4px;
    }
    
    .search-toggle svg {
        fill: #333;
    }

    
    /* 导航菜单样式 */
    .main-nav {
        display: none; /* 默认隐藏导航菜单 */
        position: fixed;
        top: 55px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.98);
        z-index: 1000;
        padding: 20px;
        overflow-y: auto;
    }
    
    .main-nav.active {
        display: block; /* 当添加active类时显示导航菜单 */
    }
    
    .main-nav ul li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    
    .main-nav ul li a.active {
        background-color: #eff6ff; /* 淡蓝色背景突出显示当前页面 */
        border-radius: 4px;
    }
    
    
    .search-box input {
        width: calc(100% - 70px); /* 减去按钮宽度和padding */
        padding: 8px 12px;
        border-radius: 20px 0 0 20px; /* 圆角搜索框 */
        border: 1px solid #1d4ed8;
    }
    
    .search-box button {
        padding: 8px 12px;
        border-radius: 0 20px 20px 0; /* 圆角按钮 */
        font-weight: 600;
    }
    
    /* 用户操作按钮样式 */
    .user-actions {
        order: 1; /* 改变用户操作按钮的顺序 */
        display: flex;
        gap: 10px;
    }
    
}

@media (max-width: 820px) {
    
    
    .search-box input {
        width: calc(100% - 70px); /* 减去按钮宽度和padding */
        padding: 8px 12px;
        border-radius: 20px 0 0 20px; /* 圆角搜索框 */
        border: 1px solid #1d4ed8;
    }
    
    .search-box button {
        padding: 8px 12px;
        border-radius: 0 20px 20px 0; /* 圆角按钮 */
        font-weight: 600;
    }
    
    /* 用户操作按钮样式 */
    .user-actions {
        order: 1; /* 改变用户操作按钮的顺序 */
        display: flex;
        gap: 10px;
    }
    
}

/* 视口 <768px：顶栏隐藏注册（仅图标时易与退出混淆）；768px 及以上仍显示 */
@media (max-width: 767px) {
    .header-container .user-actions .btn-register {
        display: none;
    }
}

/* 移动端按钮样式调整 */
@media (max-width: 768px) {
    
    .header-right {
    gap: 20px;
    }
    .login-text,.register-text {
        display: none;
    }
    
    .icon-login,.icon-register {
        display: block;
    }
    
    .search-toggle:hover,.btn-login:hover,.btn-register:hover {
        transform: scale(1.1);
    }

    .btn-login,.btn-login:hover,.btn-register,.btn-register:hover {
        color: #333;
        border: none;
        background: #fff;
        padding: 0;
    }
}

/* 更小屏幕的样式 */
@media (max-width: 480px) {
    
    .main-nav ul li a {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .search-box input {
        padding: 7px 10px;
        font-size: 13px;
    }
    
    .search-box button {
        padding: 7px 10px;
        font-size: 13px;
    }
    
    .user-actions {
        gap: 8px;
    }
    
}

/* 超小屏幕的样式 */
@media (max-width: 360px) {
    
    .main-nav ul li a {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .search-box input {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .search-box button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .user-actions {
        gap: 5px;
    }
    
}

/* 【模块-site-pagination】全站统一分页条（产品/工具/需求/模板/知识库共用） */

.site-pagination,
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* 上一页/下一页按钮 —— 兼容新旧 class 名 */
.site-pagination .site-btn-prev,
.site-pagination .site-btn-next,
.site-pagination .page-btn,
.pagination .page-btn,
.pagination .page-num {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.site-pagination .site-btn-prev:hover:not(:disabled):not(.disabled),
.site-pagination .site-btn-next:hover:not(:disabled):not(.disabled),
.site-pagination .page-btn:hover,
.pagination .page-btn:hover,
.pagination .page-num:hover {
    border-color: #2563eb;
    color: #2563eb;
}
.site-pagination .site-btn-prev:disabled,
.site-pagination .site-btn-next:disabled,
.site-pagination .page-btn.disabled,
.pagination .page-btn.disabled {
    background: #f9f9f9;
    color: #ccc;
    border-color: #eee;
    cursor: not-allowed;
}

/* 页码数字区 —— 兼容新旧 class 名 */
.site-pagination .site-page-numbers,
.site-pagination .page-nums,
.pagination .page-nums {
    display: inline-flex;
    gap: 6px;
}
.site-pagination .site-page-numbers span,
.site-pagination .page-num,
.pagination .page-num {
    min-width: auto;
    height: auto;
    padding: 6px 14px;
    border-radius: 6px;
}
.site-pagination .site-page-numbers span.current,
.pagination .page-num.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.site-pagination .site-page-numbers span.ellipsis,
.pagination .page-dots,
.site-pagination .page-dots {
    padding: 0 6px;
    color: #999;
    font-size: 13px;
    border: none;
    background: transparent;
    cursor: default;
}

/* 右侧统计信息 */
.site-pagination .site-pagination-info,
.site-pagination .page-total,
.pagination .page-total {
    margin-left: 12px;
    color: #999;
    font-size: 12px;
}

/* ★★ 手机端 ≤768px：隐藏页码和统计，只保留上一页/下一页大按钮 ★★ */
@media (max-width: 768px) {
    .site-pagination,
    .pagination {
        gap: 10px;
        margin-top: 20px;
    }
    .site-pagination .site-page-numbers,
    .site-pagination .page-nums,
    .pagination .page-nums,
    .site-pagination .site-pagination-info,
    .site-pagination .page-total,
    .pagination .page-total {
        display: none !important;
    }
    .site-pagination .site-btn-prev,
    .site-pagination .site-btn-next,
    .site-pagination .page-btn,
    .pagination .page-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 8px;
        gap: 6px;
    }
}

.paginate-item-hidden { display: none !important; }

/* 【模块-footer】页脚网格、链接与移动端折叠，匹配 includes/footer.php。 */

.footer {
    background: #333;
    color: #fff;
    padding: 40px 0 20px;
}

.footer-container {
    max-width: var(--site-max-width);
    margin: 0 auto;
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    justify-items: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px; 
}
.footer-right {
    width:100%;
}
.footer-right img {
    width:90px;
    height:90px;
}
.footer-right p:first-of-type {
    font-size: 20px;
    font-family: Impact;
}
.footer-column {
    flex: 1;
    min-width: 200px; /* 设置最小宽度 */
    margin-bottom: 20px; /* 添加底部间距 */
    padding-right: 20px; /* 添加右侧内边距 */
}

.footer h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative; /* 为下划线定位 */
}

.footer h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 2px;
    background-color: #1d4ed8; /* 添加标题下划线 */
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: block; /* 使整个区域可点击 */
    padding: 2px 0; /* 增加点击区域 */
}

.footer ul a:hover {
    opacity: 1;
    padding-left: 5px; /* 悬停时添加左侧移动效果 */
    color: #1d4ed8; /* 悬停时改变颜色 */
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 20px; /* 添加左右边距 */
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 5px;
}

/* 响应式样式 */
@media (max-width: 992px) {
    .footer-column {
        flex: 0 0 33.333%; /* 在中等屏幕上每行显示3列 */
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer-container {
            display: flex;
            justify-content: space-between;
            gap: 0.8rem;
            margin: 0.5rem 0;
            flex-wrap: wrap; 
        }

    .footer-column {
        flex: 0 0 100%;
        margin-bottom: 25px;
        padding-right: 0;
    }
    
    .footer h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer ul li {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 25px 0 10px;
    }
    
    .footer h3 {
        font-size: 15px;
    }
    
    .footer ul a {
        font-size: 13px;
    }
    
    .footer-bottom p {
        font-size: 12px;
    }
}