/* ========================================
   XTTP6 - Header, Footer, 通用组件
   ======================================== */

/* ---------- Header ---------- */
.xt6-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.xt6-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--gray-100);
}

.xt6-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
}

.xt6-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.xt6-logo-box {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
    background: var(--gradient-btn);
    color: white;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xt6-logo-text {
    display: flex;
    flex-direction: column;
}

.xt6-logo-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.xt6-logo-sub {
    font-size: 10px;
    color: var(--gray-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.xt6-nav-menu {
    display: none;
}

@media (min-width: 1024px) {
    .xt6-nav-menu {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
}

.xt6-nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: color 0.2s;
    position: relative;
}

.xt6-nav-link:hover,
.xt6-nav-link.active {
    color: var(--gray-900);
}

.xt6-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-btn);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.xt6-nav-link:hover::after,
.xt6-nav-link.active::after {
    width: 75%;
}

.xt6-nav-cta {
    display: none;
}

@media (min-width: 1024px) {
    .xt6-nav-cta {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1.5rem;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: 9999px;
    }
}

.xt6-mobile-trigger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
}

@media (min-width: 1024px) {
    .xt6-mobile-trigger { display: none; }
}

.xt6-mobile-trigger span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s;
}

.xt6-mobile-menu {
    display: none;
    background: white;
    border-top: 1px solid var(--gray-100);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.xt6-mobile-menu.is-open {
    display: block;
}

.xt6-mobile-menu .xt6-container {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.xt6-mobile-menu .xt6-drawer-link {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--gray-700);
    border-radius: var(--radius-xl);
    transition: background 0.2s, color 0.2s;
}

.xt6-mobile-menu .xt6-drawer-link:hover,
.xt6-mobile-menu .xt6-drawer-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.xt6-mobile-menu .xt6-drawer-cta {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-xl);
    color: #fff !important;
}

.xt6-mobile-menu .xt6-drawer-cta:hover {
    color: #fff !important;
}

/* ---------- Footer（参考骁通模板） ---------- */
.xt6-footer {
    background: var(--gray-50);
    padding-top: 4rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--gray-100);
}

.xt6-footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .xt6-footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .xt6-footer-inner {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2.5rem;
    }
}

.xt6-footer-brand {
    grid-column: 1 / -1;
}

@media (min-width: 1024px) {
    .xt6-footer-brand { grid-column: span 1; }
}

.xt6-footer-logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.xt6-footer-logo-row:hover {
    color: inherit;
}

.xt6-footer-logo-img {
    max-height: 2.5rem;
    width: auto;
}

.xt6-footer-desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    max-width: 24rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.xt6-footer-contact-row {
    margin-bottom: 1.5rem;
}

.xt6-footer-contact-line {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0 0 0.5rem 0;
}

.xt6-footer-contact-label {
    color: var(--gray-900);
    font-weight: 500;
}

.xt6-footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.xt6-footer-social-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
    background: white;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 700;
    transition: color 0.2s, border-color 0.2s;
}

.xt6-footer-social-btn:hover {
    color: var(--primary);
    border-color: var(--primary-border);
}

.xt6-footer-col-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.xt6-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xt6-footer-links li {
    margin-bottom: 0.75rem;
}

.xt6-footer-links a {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.xt6-footer-links a:hover {
    color: var(--primary);
}

.xt6-footer-divider {
    height: 1px;
    background: var(--gray-200);
    margin-bottom: 2rem;
}

.xt6-footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

@media (min-width: 768px) {
    .xt6-footer-bottom { flex-direction: row; }
}

.xt6-footer-copyright {
    margin: 0;
    text-align: center;
}

@media (min-width: 768px) {
    .xt6-footer-copyright { text-align: left; }
}

.xt6-footer-legal {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.xt6-footer-legal a {
    color: var(--gray-500);
}

.xt6-footer-legal a:hover {
    color: var(--primary);
}

.xt6-footer-legal-sep {
    color: var(--gray-300);
}

/* ---------- 移动端 Footer 精简版（仅显示 logo + 备案） ---------- */
.xt6-footer-mobile {
    display: none;
}

@media (max-width: 767px) {
    .xt6-footer-mobile {
        display: block;
        text-align: center;
        padding: 1.5rem 0;
    }
    .xt6-footer-mobile-logo {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--gray-900);
        margin-bottom: 0.75rem;
    }
    .xt6-footer-mobile-logo .xt6-footer-logo-img {
        max-height: 2rem;
        width: auto;
    }
    .xt6-footer-mobile-name {
        font-size: 1rem;
        font-weight: 600;
    }
    .xt6-footer-mobile-legal {
        font-size: 0.75rem;
        color: var(--gray-500);
        margin: 0;
        line-height: 1.5;
    }
    .xt6-footer-mobile-legal a {
        color: var(--gray-500);
    }
    .xt6-footer-mobile-legal a:hover {
        color: var(--primary);
    }
    /* 移动端隐藏完整版 footer 内容 */
    .xt6-footer-inner,
    .xt6-footer-divider,
    .xt6-footer-bottom {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .xt6-footer-mobile {
        display: none !important;
    }
}

/* Back to top */
.xt6-back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 40;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--gradient-btn);
    color: white;
    border: none;
    box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.5);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    /* 避免固定定位元素导致页面出现横向滚动条 */
    left: auto;
    margin: 0;
}

.xt6-back-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.xt6-back-top:hover {
    transform: translateY(-2px);
}

.xt6-back-top svg {
    display: block;
    margin: auto;
}

/* 移动端：防止横向滚动，并调整 back-top 位置 */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .xt6-back-top {
        right: 1rem;
        bottom: 1.25rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}
