/* ============ 设计 Token（取自设计图紫色系） ============ */
:root {
    --c-primary: #6c5ce7;
    --c-primary-dark: #5b4bd1;
    --c-primary-soft: #f0e6ff;
    --c-primary-soft-2: #e8dcff;
    --c-bg: #ffffff;
    --c-bg-page: #faf9ff;
    --c-text: #1a1a2e;
    --c-text-sub: #6b6b80;
    --c-border: #ece9f5;
    --c-shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.06);
    --c-shadow: 0 6px 20px rgba(108, 92, 231, 0.12);
    --c-shadow-lg: 0 12px 32px rgba(108, 92, 231, 0.18);

    --sidebar-w: 13rem;
    --sidebar-w-mid: 4.5rem;
    --radius: 0.75rem;
    --radius-lg: 1.25rem;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
    background: var(--c-bg-page);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* 为固定侧边栏让出空间 */
    padding-left: var(--sidebar-w);
    transition: padding 0.25s var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

/* ============ 面包屑导航（页面路径，吸顶不占文档流） ============ */
.breadcrumb {
    position: absolute;
    top: 0.5rem;
    left: 3rem;
    right: 3rem;
    z-index: 12;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--c-text-sub);
    line-height: 1.5;
}
.breadcrumb__link {
    color: var(--c-text-sub);
    transition: color 0.15s var(--ease);
}
.breadcrumb__link:hover {
    color: var(--c-primary);
}
.breadcrumb__sep {
    color: var(--c-text-sub);
    opacity: 0.6;
    user-select: none;
}
.breadcrumb__label {
    color: var(--c-text-sub);
    opacity: 0.6;
    user-select: none;
}

/* ============ 整体布局：左侧栏 + 右侧主区 ============ */
.app { display: flex; min-height: 100vh; }

/* ============ 侧边栏（一级导航） ============ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--c-bg);
    border-right: 1px solid var(--c-border);
    padding: 1.25rem 0.75rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 20;
    transition: transform 0.25s var(--ease);
}
.sidebar__logo img {
    margin-top: -0.75rem;
}
.sidebar__logo {
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--c-primary-soft-2);
}

/* 一级导航项 */
.sidebar__nav li a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--c-text);
    font-size: 0.875rem;
    position: relative;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.sidebar__nav li a::before {
    /* active 左侧指示条 */
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 3px; height: 0;
    background: var(--c-primary);
    border-radius: 0 2px 2px 0;
    transform: translateY(-50%);
    transition: height 0.2s var(--ease);
}
/* hover：黑色边框 + 圆角 */
.sidebar__nav li a:hover {
    border: 1px solid #000;
    color: var(--c-primary);
    padding-left: 0.875rem;
}
.sidebar__nav li a.active {
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-weight: 600;
}
.sidebar__nav li a.active::before { height: 1.2rem; }
/* 图标徽章：圆角方框承载，hover/active 时变主题色 */
.sidebar__nav img,
.sidebar__nav .nav-item__icon {
    width: 1.5rem; height: 1.5rem;
    border-radius: 0.4rem;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}
.sidebar__nav li a:hover img { transform: scale(1.1); }
.sidebar__nav span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}

/* ============ 一级：展开箭头 ============ */
.nav-item__link { width: 100%; }
.nav-item__arrow {
    margin-left: auto;
    width: 0; height: 0;
    border-left: 4px solid var(--c-text-sub);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.3s var(--ease), border-color 0.2s var(--ease);
    flex-shrink: 0;
}
.nav-item.open > .nav-item__link .nav-item__arrow {
    transform: rotate(90deg);
    border-left-color: var(--c-primary);
}
/* 一级展开态：标题强调 */
.nav-item.open > .nav-item__link {
    color: var(--c-primary);
    font-weight: 600;
}

/* ============ 二级分类：树形连接线 + 入场动画 ============ */
/* display:none 默认隐藏，由 JS slideDown/slideUp 控制高度动画（比 max-height 过渡丝滑） */
.nav-sub {
    display: none;
    margin: 0;
    list-style: none;
    /* 左侧连接线：从一级延伸下来的竖线 */
    border-left: 1px solid var(--c-border);
    margin-left: 1.3rem;
    padding: 0.25rem 0 0.25rem 0.625rem;
}
.nav-sub li { 
    margin: 0; 
    position: relative;
}
.nav-sub li a {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.625rem 0.4rem 0.875rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    color: var(--c-text-sub);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
/* 树形横线：连接竖线与文字 */
.nav-sub li a::before {
    content: "";
    position: absolute;
    left: -0.625rem;
    top: 50%;
    width: 0.5rem; height: 1px;
    background: var(--c-border);
    transition: background 0.2s var(--ease), width 0.2s var(--ease);
}
/* hover：横线变主题色并延长，文字变主题色 */
.nav-sub li a:hover {
    color: var(--c-primary);
    background: var(--c-primary-soft);
}
.nav-sub li a:hover::before {
    background: var(--c-primary);
    width: 0.625rem;
}
/* 选中态：实心主题色 */
.nav-sub li a.active {
    background: var(--c-primary);
    color: #fff;
    font-weight: 600;
}
.nav-sub li a.active::before { background: var(--c-primary); }

/* 二级项入场动画：展开时逐项淡入（配合 slideDown） */
.nav-item.open > .nav-sub > li {
    animation: navSubFadeIn 0.3s var(--ease) both;
}
.nav-item.open > .nav-sub > li:nth-child(1) { animation-delay: 0.03s; }
.nav-item.open > .nav-sub > li:nth-child(2) { animation-delay: 0.06s; }
.nav-item.open > .nav-sub > li:nth-child(3) { animation-delay: 0.09s; }
.nav-item.open > .nav-sub > li:nth-child(4) { animation-delay: 0.12s; }
.nav-item.open > .nav-sub > li:nth-child(5) { animation-delay: 0.15s; }
.nav-item.open > .nav-sub > li:nth-child(n+6) { animation-delay: 0.18s; }
@keyframes navSubFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============ 主内容区 ============ */
.main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
}

/* 顶部导航（hover 下拉面板） */
.topbar {
    display: flex; align-items: center; gap: 1.875rem;
    padding: 0 1.25rem;
    height: 3.75rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #f2f2f2;
    position: sticky; top: 0; z-index: 15;
}
.topbar-item { position: relative; display: flex; align-items: center; }
/* 填充导航项与下拉面板之间的空隙，避免鼠标穿过时 hover 中断 */
.topbar-item::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    height: 0.5rem;
    z-index: 24;
}
.topbar a {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0;
    font-weight: 400;
    font-size: 14px;
    color: #656565;
    line-height: 26px;
    transition: color 0.15s var(--ease);
}
.topbar a:hover { color: var(--c-primary); }
.topbar img { width: 14px; height: 14px; object-fit: contain; }
/* 所有分类的下拉箭头 */
.topbar-item__arrow {
    width: 6px; height: 4px;
    background: url("/img/top-arrow.png") center / contain no-repeat;
    margin-left: 0.5625rem;
    flex-shrink: 0;
}
/* 下拉面板 */
.dropdown {
    position: absolute; top: calc(100% + 0.5rem); left: 0;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--c-shadow-lg);
    padding: 0.5rem;
    min-width: 13rem;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
    z-index: 25;
}
.topbar-item:hover .dropdown,
.topbar-item.is-open .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}
.dropdown a:hover { background: var(--c-primary-soft); color: var(--c-primary); }

/* 内容容器 */
.content {
    padding: 2rem 3rem 3rem;
    width: auto;
    background-color: #FBFBFD;
    background-image: url('/img/new-bannar.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}
.content-ai {
    background-image: url('/img/home-hero-bg.png');
}
    /* ============ Hero 区（横向布局：左文案 + 右搜索） ============ */
    .hero {
        /*    background: linear-gradient(135deg, var(--c-primary-soft) 0%, #ffffff 100%);
    border-radius: var(--radius-lg);*/
        padding: 1.5rem 1.75rem;
        margin-bottom: 1.5rem;
        /*    border: 1px solid var(--c-primary-soft-2);*/
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        animation: heroFadeUp 0.6s var(--ease) both;
    }
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero__text { min-width: 0; }
.hero__title {
    font-size: clamp(1.3rem, 0.9rem + 1.2vw, 1.85rem);
    font-weight: 700; color: var(--c-text);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}
.hero__desc {
    color: var(--c-text-sub); font-size: 0.875rem;
    margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--c-bg);
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    padding: 0.35rem 0.35rem 0.35rem 0.9rem;
    width: 22rem;
    max-width: 100%;
    flex-shrink: 0;
    box-shadow: var(--c-shadow-sm);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* 聚焦反馈：边框变主题色 + 阴影加深 */
.search:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12), var(--c-shadow);
}
.search img { width: 1.05rem; height: 1.05rem; opacity: 0.6; flex-shrink: 0; }
.search input {
    flex: 1; border: none; outline: none;
    font-size: 0.875rem; background: transparent; color: var(--c-text);
    min-width: 0;
}
.search input::placeholder { color: var(--c-text-sub); }
.search button {
    background: var(--c-primary); color: #fff;
    border: none; border-radius: 0.5rem;
    padding: 0.45rem 1.1rem; font-size: 0.825rem;
    cursor: pointer; white-space: nowrap;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.search button:hover { background: var(--c-primary-dark); }
.search button:active { transform: scale(0.96); }

/* 响应式：窄屏纵向堆叠 */
@media (max-width: 767px) {
    .hero {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem;
    }
    .hero__desc { white-space: normal; }
    .search { width: 100%; }
}

/* 移动端汉堡按钮 */
.menu-toggle {
    display: none;
    background: none; border: none; cursor: pointer; padding: 0.4rem;
    flex-direction: column; gap: 4px;
}
.menu-toggle span {
    width: 1.5rem; height: 2px; background: var(--c-text);
    border-radius: 2px; transition: 0.25s var(--ease);
}
.overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 18;
}
.overlay.show { display: block; }
/* 顶部下拉面板遮罩：默认隐藏，仅移动端展开下拉时显示（样式见响应式段） */
.dropdown-mask { display: none; }

/* ============ 返回顶部按钮（小火箭） ============ */
.back-top {
    position: fixed; right: 1.5rem; bottom: 1.5rem;
    width: 3rem; height: 3rem;
    border: none;
    background: linear-gradient(160deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: 50%;
    box-shadow: var(--c-shadow), inset 0 1px 0 rgba(255,255,255,0.25);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.8);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.25s var(--ease);
    z-index: 30;
    padding: 0;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-top:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--c-shadow-lg), inset 0 1px 0 rgba(255,255,255,0.35);
}
/* 火箭机身（向上箭头：双 border 拼成尖头 + 圆角矩形机身） */
.back-top::before {
    content: "";
    width: 0.5rem; height: 0.5rem;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(45deg) translate(1px, 1px);
    margin-bottom: 0.45rem;
    position: relative; z-index: 2;
}
.back-top::after {
    content: "";
    width: 0.55rem; height: 0.9rem;
    background: #fff;
    border-radius: 0 0 3px 3px;
    margin-top: 0.2rem;
    position: absolute; z-index: 1;
}
/* 尾部喷射火焰（hover/launching 时点燃） */
.back-top .flame {
    position: absolute;
    left: 50%; bottom: -0.55rem;
    transform: translateX(-50%);
    width: 0.7rem; height: 0;
    background: linear-gradient(180deg,
        #ffd166 0%,
        #ff8c42 45%,
        #ff5a5f 80%,
        rgba(255,90,95,0) 100%);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    opacity: 0;
    transition: height 0.2s var(--ease), opacity 0.2s var(--ease);
    z-index: 0;
}
.back-top:hover .flame,
.back-top.launching .flame {
    height: 1.1rem;
    opacity: 1;
    animation: flameFlicker 0.12s linear infinite;
}
@keyframes flameFlicker {
    0%   { transform: translateX(-50%) scaleY(1) scaleX(1);  opacity: 1; }
    100% { transform: translateX(-50%) scaleY(0.82) scaleX(1.18); opacity: 0.8; }
}
/* 点击发射：火箭整体上窜后回归 */
.back-top.launching {
    animation: rocketLaunch 0.5s var(--ease);
}
@keyframes rocketLaunch {
    0%   { transform: translateY(0) scale(1.05); }
    35%  { transform: translateY(-22px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

/* ============ 公共底部 ============ */
.footer {
    background: #FBFBFD;
    color: #333333;
    padding: 3.75rem 1.5rem 2.5rem;
/*    margin-top: 3rem;*/
    position: relative;
    border-top: 1px solid #F2F2F2;
}
.footer__inner {
    max-width: 75rem;
    width: 100%;
    margin: 0 auto;
}
.footer__grid {
    display: grid;
    grid-template-columns: 2.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(51, 51, 51, 0.08);
}
/* 品牌列 */
.footer__logo {
    margin-bottom: 1rem;
}
.footer__logo img {
    display: block;
    width: 300px;
    height: auto;
}
.footer__desc {
    font-size: 0.875rem;
    line-height: 1.85;
    color: #555555;
    max-width: 22rem;
}
/* 标题 */
.footer__title {
    font-size: 1rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 1.1rem;
    line-height: 1;
}
/* 链接列表 */
.footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer__link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #333333;
    transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}
.footer__link:hover {
    color: var(--c-primary);
    transform: translateX(2px);
}
/* 圆点列表符号 */
.footer__dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--c-primary);
    flex-shrink: 0;
}
/* 友情链接条 */
.footer__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    background: #f0f0f0;
    border-radius: 0.5rem;
    padding: 1.5rem 2.5rem;
    margin: 3rem 0 1.5rem;
}
.footer__links-label {
    font-size: 0.875rem;
    color: #333333;
    flex-shrink: 0;
}
.footer__links-text {
    font-size: 0.875rem;
    color: #666666;
    line-height: 1.6;
}
.footer__links-item {
    display: inline-block;
    margin-right: 1.25rem;
    color: #666666;
    transition: color 0.15s var(--ease);
}
.footer__links-item:hover {
    color: var(--c-primary);
}
/* 版权 */
.footer__copyright {
    font-size: 0.875rem;
    color: #333333;
    text-align: left;
    line-height: 1.6;
    margin-top: 2.5rem;
}

/* ============ 响应式断点 ============ */
/* 平板：侧边栏收起为图标栏 */
@media (max-width: 1023px) {
    :root { --sidebar-w: var(--sidebar-w-mid); }
    .sidebar__logo { font-size: 0.7rem; }
    .sidebar__nav li a { justify-content: center; padding: 0.6rem; }
    .sidebar__nav li a:hover { padding-left: 0.6rem; }
    .sidebar__nav span { display: none; }
    /* 底部：四列转两列 */
    .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer__brand { grid-column: 1 / -1; }
}
/* 手机：侧边栏转抽屉 + 卡片单列 */
@media (max-width: 767px) {
    body { padding-left: 0; }
    .sidebar {
        position: fixed; left: 0; top: 0;
        transform: translateX(-100%);
        width: 14rem;
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar__nav li a { justify-content: flex-start; }
    .sidebar__nav span { display: inline; }
    .sidebar__logo { font-size: 1.1rem; }
    .menu-toggle { display: flex; }
    .content { padding: 1.25rem 2rem 2rem; }
    .back-top { right: 1rem; bottom: 1rem; }
    .topbar {
        padding: 0.45rem 0.75rem;
        gap: 0.5rem;
        height: 3rem;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* 移除 backdrop-filter 与 opacity：二者均会让 .topbar 成为后代 position:fixed 的包含块/透明组，
           导致移动端 .dropdown 浮层被 .topbar 的 overflow 裁剪且整体半透明而不可见；改用半透明背景代替。 */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.9);
    }
    .topbar::-webkit-scrollbar { display: none; }
    .topbar-item { flex-shrink: 0; }
    .topbar a { padding: 0; font-size: 0.78rem; gap: 0.25rem; white-space: nowrap; }
    .topbar img { width: 12px; height: 12px; flex-shrink: 0; }
    .topbar-item__arrow { margin-left: 0.25rem; }
    /* 下拉面板：移动端脱离 topbar 滚动容器，以全屏浮层方式展开 */
    .topbar .dropdown {
        position: fixed;
        left: 0;
        right: 0;
        top: 3rem;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0 0 0.75rem 0.75rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    .topbar-item.is-open .dropdown { display: block; }
    /* 下拉面板遮罩：盖住顶栏下方内容；z-index 低于 .topbar(15)，使顶栏与下拉浮层可见 */
    .dropdown-mask {
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 14;
        cursor: pointer;
    }
    .dropdown-mask.show { display: block; }
    /* 底部：单列堆叠 */
    .footer { padding: 2.25rem 1rem 1.5rem; margin-top: 2rem; }
    .footer__grid { grid-template-columns: 1fr; gap: 1.75rem; padding-bottom: 1.75rem; }
    .footer__brand { grid-column: auto; }
    .footer__links { padding: 1rem 1.25rem; margin: 1.75rem 0; }
    .footer__copyright { text-align: left; margin-top: 1.75rem; }
}

/* 尊重用户减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
