/* 设计变量 */
:root {
    /* 颜色 */
    --fill-color-divider: #eff0f2;
    --text-color-primary: #000614;
    --text-color-secondary: #5e6472;
    --text-color-tertiary: #8d93a1;
    --text-color-disabled: #c4c7ce;
    --fill-color-brand: #ff0011;
    --fill-color-container: #ffffff;
    --fill-color-bg: #f5f6f7;
    --fill-color-tertiary: #e5e7eb;
    
    /* 字体 */
    --font-family-body: 'Roboto', sans-serif;
    --font-family-figure: 'Roboto Mono', sans-serif;
    --font-size-lg: 20px;
    --font-size-md: 16px;
    --font-size-sm: 12px;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-line-height-single-lg: 20px;
    --font-line-height-single-md: 16px;
    --font-line-height-single-sm: 12px;
    --font-line-height-multi-lg: 26px;
    --font-line-height-multi-md: 22px;
    --font-line-height-multi-sm: 18px;
    
    /* 间距 */
    --spacing-gap-22x: 88px;
    --spacing-gap-20x: 80px;
    --spacing-gap-11x: 44px;
    --spacing-gap-8x: 32px;
    --spacing-gap-6x:24px;
    --spacing-gap-5x: 20px;
    --spacing-gap-4x: 16px;
    --spacing-gap-3x: 12px;
    --spacing-gap-2x: 8px;
    --spacing-gap-1x: 4px;

    /* 圆角 */
    --border-radius-2x: 8px;
    
    /* 断点 */
    --breakpoint-desktop: 1964px;
    --breakpoint-tablet: 1528px;
    --breakpoint-mobile: 1008px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--fill-color-container);
    height: 100%;
}

body {
    font-family: var(--font-family-body);
    font-weight: var(--font-weight-regular);
    color: var(--text-color-primary);
    overflow: hidden;
    height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* 应用容器 */
.app {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: var(--fill-color-container);
}

/* 左侧固定菜单栏 */
.sidebar {
    width: 400px;
    height: 100vh;
    padding: var(--spacing-gap-11x);
    background: transparent;
    position: relative;
    flex-shrink: 0;
    z-index: 100;
}

/* 首页状态下的侧边栏 - 浮在视频上方，背景透明 */
.app.home-active .sidebar {
    position: relative;
    width: 400px;
    background: transparent; /* 确保背景完全透明 */
    z-index: 10; /* 确保在视频上方 */
    padding: var(--spacing-gap-11x);
}

/* 右侧主内容区域 */
.main-content {
    flex: 1;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--fill-color-container);
    transition: opacity 0.3s linear, transform 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97);
}

/* 首页状态下的主内容区域 - 确保在视频上方 */
.app.home-active .main-content {
    flex: 1;
    height: 100vh;
    position: relative;
    z-index: 5; /* 确保在视频上方 */
    background: transparent; /* 确保背景透明，显示下方视频 */
}

/* 视频背景 */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 首页状态下的视频背景 - 填充整个显示区域 */
.app.home-active .video-background {
    position: fixed; /* 固定定位，覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100vw; /* 填充整个视口宽度 */
    height: 100vh; /* 填充整个视口高度 */
    z-index: 1; /* 在侧边栏下方 */
}



/* 左侧导航菜单 */
.side-menu {
    display: flex;
    flex-direction: column;
    justify-content: start;
    height: 100%;
    width: 100%;
}

.main-menu {
    list-style: none;
}

.main-menu li {
    margin-bottom: var(--spacing-gap-2x);
    display: flex;
    align-items: center;
    gap: 2px; /* 统一设置为2px间距 */
    position: relative;
}

/* 确保最后一个主菜单项也有底部间距 */
.main-menu li:last-child {
    margin-bottom: var(--spacing-gap-2x);
}

.main-menu a {
    font-size: var(--font-size-lg);
    line-height: var(--font-line-height-single-lg);
    color: var(--text-color-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s linear;
}

/* 菜单交互状态 */
.dropdown-icon {
    transform: rotate(180deg); /* 默认向下 */
    transition: transform 0.3s cubic-bezier(0.42, 0, 0.58, 1), filter 0s linear; /* 添加颜色过渡 */
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 默认黑色 #000614 */
    margin-top: 2px;/* 移除margin-top，使用flex布局自动居中对齐 */
}

/* Default state - 默认状态 */
.main-menu li a {
    color: var(--text-color-primary);
}

/* Hover state - 悬停状态 */
.main-menu li.hover > a,
.main-menu li > a:hover {
    color: var(--text-color-secondary);
}

.main-menu li.hover > .dropdown-icon,
.main-menu li > a:hover + .dropdown-icon {
    /* hover时不旋转箭头，保持原来的方向 */
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

/* Pressed state - 按下状态 (优先级最高) */
.main-menu li.pressed > a {
    color: var(--text-color-tertiary) !important;
}

.main-menu li.pressed > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important; /* 按下中灰色 #8d93a1 */
}

/* Selected state - 选中状态 */
.main-menu li.selected a {
    color: var(--text-color-primary);
}

.main-menu li.selected > .dropdown-icon {
    transform: rotate(0deg); /* 选中时向上 */
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 选中黑色 #000614 */
}

/* Unselected state - 未选中状态 */
.main-menu li.unselected a {
    color: var(--text-color-disabled) !important;
}

.main-menu li.unselected > .dropdown-icon {
    transform: rotate(180deg); /* 未选中时向下 */
    filter: brightness(0) saturate(100%) invert(80%) sepia(3%) saturate(299%) hue-rotate(196deg) brightness(98%) contrast(94%); /* 未选中浅灰色 #c4c7ce */
}

/* Expanded state - 展开状态 */
.main-menu li.expanded a {
    color: var(--text-color-primary);
}

.main-menu li.expanded > .dropdown-icon {
    transform: rotate(0deg); /* 展开时向上 */
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 展开黑色 #000614 */
}

/* 状态优先级控制 - 确保pressed状态优先级最高 */
.main-menu li.pressed > a:hover {
    color: var(--text-color-tertiary) !important;
}

.main-menu li.pressed > a:hover + .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important;
}

/* 确保主菜单pressed状态不影响子菜单 */
.main-menu li.pressed .submenu-item > a {
    color: var(--text-color-primary) !important;
}

.main-menu li.pressed .submenu-item > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%) !important;
    transform: rotate(180deg) !important;
}

/* 确保主菜单pressed状态不影响已选中的子菜单 */
.main-menu li.pressed .submenu-item.selected > a {
    color: var(--text-color-primary) !important;
}

.main-menu li.pressed .submenu-item.selected > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%) !important;
    transform: rotate(0deg) !important;
}

/* 确保主菜单pressed状态不影响未选中的子菜单 */
.main-menu li.pressed .submenu-item.unselected > a {
    color: var(--text-color-disabled) !important;
}

.main-menu li.pressed .submenu-item.unselected > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(80%) sepia(3%) saturate(299%) hue-rotate(196deg) brightness(98%) contrast(94%) !important;
    transform: rotate(180deg) !important;
}

/* 选中状态下的hover效果 - 允许hover颜色显示 */
.main-menu li.selected.hover > a {
    color: var(--text-color-secondary);
}

.main-menu li.selected.hover > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

.main-menu li.unselected > a:hover {
    color: var(--text-color-secondary) !important;
}

.main-menu li.unselected > a:hover + .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

/* 主菜单未选中状态的pressed样式 */
.main-menu li.unselected.pressed > a {
    color: var(--text-color-tertiary) !important;
}

.main-menu li.unselected.pressed > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important; /* 按下中灰色 #8d93a1 */
}

/* 子菜单样式 */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.3s linear, transform 0.3s cubic-bezier(0.42,0.00,0.09,0.97);
    margin-top: var(--spacing-gap-1x);
    width: 100%;
}

/* 确保箭头图标在菜单文字右边，同行居中显示 */
.has-submenu {
    display: flex;
    align-items: center;
    gap: var(--spacing-gap-1x); /* 菜单文字与箭头图标间距4px */
    flex-wrap: wrap; /* 允许子菜单换行到下方 */
}

.has-submenu > a {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0; /* 防止文字压缩 */
}

.has-submenu > .dropdown-icon {
    flex-shrink: 0; /* 防止箭头压缩 */
}

/* 子菜单占据整行，在父菜单下方 */
.has-submenu > .submenu {
    width: 100%;
    flex-basis: 100%; /* 强制子菜单换行 */
}

/* 展开状态的子菜单 - 通过JavaScript控制 */
.has-submenu.expanded .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 子菜单动画优化 */
.submenu.animating {
    display: block;
}

.submenu-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: var(--spacing-gap-1x); /* 统一设置为4px间距 */
    position: relative;
}

/* 保持所有子菜单项统一8px间距，包括最后一个 */
.submenu-item:last-child {
    margin-bottom: var(--spacing-gap-2x);
}

/* 菜单缩进布局 */
/* 一级菜单：无缩进，左对齐 */
.main-menu > li {
    margin-left: 0;
}

/* 二级菜单：无缩进，左对齐（与一级菜单对齐） */
.level-2 {
    margin-left: 0;
}

/* 三级菜单：向右缩进 */
.level-3 {
    margin-left: var(--spacing-gap-5x);
}

/* 子菜单链接样式 */
.submenu-item > a {
    font-size: var(--font-size-lg);
    line-height: var(--font-line-height-single-lg);
    color: var(--text-color-primary); /* 默认状态为黑色 */
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s linear;
}

/* 子菜单交互状态 */
.submenu-item .dropdown-icon {
    transform: rotate(180deg); /* 默认向下 */
    transition: transform 0.3s cubic-bezier(0.42, 0, 0.58, 1), filter 0.3s linear; /* 添加颜色过渡 */
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 默认黑色 #000614 */
}

/* 子菜单 hover 状态 - 只通过JavaScript类控制，移除原生hover */
.submenu-item.hover > a {
    color: var(--text-color-secondary) !important;
}

.submenu-item.hover > .dropdown-icon {
    /* hover时不旋转箭头，保持原来的方向 */
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

/* 子菜单 pressed 状态 (优先级最高) */
.submenu-item.pressed > a {
    color: var(--text-color-tertiary) !important;
}

.submenu-item.pressed > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important; /* 按下中灰色 #8d93a1 */
}

/* 子菜单 selected 状态 */
.submenu-item.selected > a {
    color: var(--text-color-primary);
}

.submenu-item.selected > .dropdown-icon {
    transform: rotate(0deg);
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 选中黑色 #000614 */
}

/* 子菜单 unselected 状态 */
.submenu-item.unselected > a {
    color: var(--text-color-disabled) !important;
}

.submenu-item.unselected > .dropdown-icon {
    transform: rotate(180deg);
    filter: brightness(0) saturate(100%) invert(80%) sepia(3%) saturate(299%) hue-rotate(196deg) brightness(98%) contrast(94%); /* 未选中浅灰色 #c4c7ce */
}

/* 子菜单未选中状态的pressed样式 */
.submenu-item.unselected.pressed > a {
    color: var(--text-color-tertiary) !important;
}

.submenu-item.unselected.pressed > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important; /* 按下中灰色 #8d93a1 */
    transform: rotate(0deg) !important;
}

/* 子菜单 expanded 状态 */
.submenu-item.expanded > a {
    color: var(--text-color-primary);
}

.submenu-item.expanded > .dropdown-icon {
    transform: rotate(0deg);
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%); /* 展开黑色 #000614 */
}

/* 子菜单状态优先级控制 */
.submenu-item.pressed > a:hover {
    color: var(--text-color-tertiary) !important;
}

.submenu-item.pressed > a:hover + .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%) !important;
}

/* 确保pressed状态只影响直接子元素，不传播到嵌套子菜单 */
.submenu-item.pressed > .submenu .submenu-item > a {
    color: var(--text-color-primary) !important;
}

.submenu-item.pressed > .submenu .submenu-item > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%) !important;
    transform: rotate(180deg) !important;
}

/* 子菜单选中状态下的hover效果 - 允许hover颜色显示 */
.submenu-item.selected.hover > a {
    color: var(--text-color-secondary);
}

.submenu-item.selected.hover > .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

.submenu-item.unselected > a:hover {
    color: var(--text-color-secondary) !important;
}

.submenu-item.unselected > a:hover + .dropdown-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

/* 激活的子菜单项 */
.submenu-item.active > a {
    color: var(--text-color-primary);
}

/* 主菜单激活状态 */
.main-menu > li.active > a {
    color: var(--fill-color-brand);
}

/* 针对最终页面的激活状态（无子菜单的页面） */
.main-menu > li.active:not(.has-submenu) > a,
.submenu-item.active:not(.has-submenu) > a {
    color: var(--fill-color-brand);
}

/* 嵌套子菜单的展开 */
.submenu-item.has-submenu.expanded .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    margin-top: var(--spacing-gap-1x);
}

/* 天猫logo */
.logo {
    margin-top: auto;
}

.logo a {
    display: block;
}

.logo img {
    transition: opacity 0.3s linear;
}

.logo:hover img {
    opacity: 0.7;
}

/* 页脚信息 */
.page-footer {
    position: fixed;
    bottom: var(--spacing-gap-11x);
    right: var(--spacing-gap-11x);
    z-index: 10;
}

/* 首页状态下的页脚 */
.app.home-active .page-footer {
    z-index: 150;
}

.footer-info {
    text-align: left;
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-tertiary);
}

.footer-info p {
    margin: 0;
}

/* 内容页面样式 - 直接应用到content-body */
.content-body {
    height: 100vh;
    overflow: visible; /* 允许子元素处理自己的滚动 */
    position: relative;
}



/* ==== 三栏布局样式 ==== */
.three-column-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
}

/* 控件操作栏 */
.control-panel {
    width: 102px;
    height: 100vh;
    /*background: #f5f6f7;*/
    position: fixed;
    overflow: visible;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding-top: var(--spacing-gap-11x);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.control-panel.visible {
    opacity: 1;
}

.tab-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 10px;
    margin-top: 2px;
}

.tab-rule {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-disabled);
    cursor: pointer;
    transition: color 0.2s linear;
    text-align: center;
    margin-right: var(--spacing-gap-2x);
}

.tab-rule.active {
    color: var(--text-color-primary);
}

.tab-rule:hover,
.tab-rule.active:hover {
    color: var(--text-color-secondary);
}

.tab-rule:active,
.tab-rule.active:active {
    color: var(--text-color-tertiary);
}

.tab-separator {
    width: 1px;
    height: 12px;
    background-color: var(--fill-color-divider);
}

.tab-prompt {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-disabled);
    cursor: pointer;
    transition: color 0.2s linear;
    text-align: center;
    margin-left: var(--spacing-gap-2x);
    position: relative;
}

.tab-prompt .gradient-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,#fc0011 10%,#f8aeb2 25%,#FFE4DE 50%,#f8aeb2 75%,#fc0011 90%);
    background-size: 500% 500%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    z-index: 1;
}

.tab-prompt.active {
    color: var(--text-color-primary);
}

.tab-prompt:hover:not(.active) {
    animation: text-to-secondary 1s linear;
    color: var(--text-color-secondary);
}

.tab-prompt:hover:not(.active) .gradient-text {
    animation: gradient-to-secondary 1s linear forwards;
}

.tab-prompt.active:hover {
    color: var(--text-color-secondary);
}

@keyframes gradient-to-secondary {
    0% {
        opacity: 0;
        background-position: 100% 50%;
    }
    20% {
        opacity: 1;
        background-position: 100% 50%;
    }
    80% {
        opacity: 1;
        background-position: 0% 50%;
    }
    100% {
        opacity: 0;
        background-position: 0% 50%;
    }
}

@keyframes text-to-secondary {
    0% {
        color: var(--text-color-disabled);
    }
    20% {
        color: transparent;
    }
    80% {
        color: transparent;
    }
    100% {
        color: var(--text-color-secondary);
    }
}

.tab-prompt:active,
.tab-prompt.active:active {
    color: var(--text-color-tertiary) !important;
    animation: none !important;
}

.icon-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: end;
    margin-right: -10px;
    position: relative; /* 为toast提供定位基准 */
}

.icon-button {
    width: 40px;
    height: 40px;
    background-color: var(--fill-color-container);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s linear, filter 0.2s linear;
}

.icon-button:hover {
    background-color: var(--fill-color-bg);
}

.icon-button img:active {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%); /* 悬停灰色 #5e6472 */
}

/* Toast样式 */
.toast {
    position: absolute;
    right: calc(100% + 20px); /* 距离icon-buttons左侧20px */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-gap-1x);
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}

.toast-text {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--font-line-height-single-sm);
    color: var(--text-color-tertiary);
    text-align: right;
}

.toast-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* 内容区 */
.content-area {
    position: fixed;
    top: 0;
    padding-top: var(--spacing-gap-11x); /* 添加顶部内边距 */
    padding-bottom: var(--spacing-gap-11x); /* 添加底部内边距 */
    /*background: #f5f6f7;*/
    height: 100vh;
    width: auto;
    overflow-y: auto;
    overscroll-behavior: bounce; /* 启用橡皮筋回弹效果 */
    -webkit-overflow-scrolling: touch; /* iOS橡皮筋回弹效果 */
    scroll-behavior: smooth; /* 平滑滚动 */
    will-change: scroll-position; /* 优化滚动性能 */
    box-sizing: border-box;
    z-index: 40;
    
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    
    /* 动画相关样式 - 强制隐藏，防止任何闪现 */
    opacity: 0 !important; /* 初始状态隐藏整个内容区 */
    visibility: hidden !important; /* 双重保险隐藏 */
    transition: opacity 0.2s ease;
}

/* 隐藏滚动条 - WebKit浏览器 */
.content-area::-webkit-scrollbar {
    display: none;
}

.preface {
    width: 100%;
    margin-bottom: var(--spacing-gap-11x);
}

.preface p {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-multi-md);
    color: var(--text-color-primary);
}

sup {
    font-size: 0.7em;
    position: relative; 
    top: 0.26em;  
    line-height: 1; 
}

.rule-content {
    width: 100%;
}

.rule-section {
    margin: 0px;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-gap-11x);
}

.rule-section:last-child {
    margin-bottom: 0px;
}

.rule-section h2 {
    font-family: var(--font-family-body);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-single-lg);
    color: var(--text-color-primary);
    margin-bottom: var(--spacing-gap-8x);
}

.rule-section h4 {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-md);
    color: var(--text-color-primary);
    margin-top: var(--spacing-gap-11x);
}

.rule-section p {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-multi-md);
    color: var(--text-color-primary);
    margin-bottom: var(--spacing-gap-6x);
}

.rule-section p:last-child {
    margin-bottom: 0px;
}

.url-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-multi-md);
    color: var(--text-color-tertiary);
    text-decoration: none;
    transition: color 0.2s linear;
}

.url-link .link-icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    margin-bottom: 4px;
    color: #000000; /* 设置基础颜色，配合 currentColor 使用 */
    filter: invert(61%) sepia(7%) saturate(395%) hue-rotate(185deg) brightness(91%) contrast(86%);
    transition: filter 0.2s linear;
    opacity: 0;
    transition: opacity 0.2s linear, filter 0.2s linear;
    will-change: opacity;
}

.url-link:hover {
    color: var(--text-color-secondary);
}

.url-link:hover .link-icon {
    filter: invert(41%) sepia(7%) saturate(779%) hue-rotate(185deg) brightness(92%) contrast(87%);
}

/* link-icon动画显示状态 */
/* .link-icon 动画现在由JavaScript控制，移除CSS动画 */

.url-link:active {
    color: var(--text-color-tertiary);
}

.url-link:active .link-icon {
    filter: invert(61%) sepia(7%) saturate(395%) hue-rotate(185deg) brightness(91%) contrast(86%);
}

.media-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-multi-md);
    color: var(--text-color-primary) ;
    text-decoration: none;
    transition: color 0.2s linear;
}

.media-link .media-link-icon {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    margin-bottom: 3px;
    color: #000000; /* 设置基础颜色，配合 currentColor 使用 */
    filter: invert(3%) sepia(8%) saturate(6880%) hue-rotate(193deg) brightness(90%) contrast(101%);
    transition: filter 0.2s linear;
    opacity: 0;
    transition: opacity 0.2s linear, filter 0.2s linear;
    will-change: opacity;
}

.media-link:hover {
    color: var(--text-color-secondary);
}

.media-link:hover .media-link-icon {
    filter: invert(41%) sepia(7%) saturate(779%) hue-rotate(185deg) brightness(92%) contrast(87%);
}

.media-link:active {
    color: var(--text-color-tertiary);
}

.media-link:active .media-link-icon {
    filter: invert(61%) sepia(7%) saturate(395%) hue-rotate(185deg) brightness(91%) contrast(86%);
}

.grid {
  display: grid;
  grid-template-columns: 200px 1fr;  /* 左栏固定，右栏自适应 */
  gap: 3px 40px;   
}

.section-image {
    width: 100%;
    overflow: hidden; 
    border-radius: var(--border-radius-2x);
    margin-bottom: var(--spacing-gap-3x);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

/* section-image加载中状态 */
.section-image.loading {
    background-color: var(--fill-color-bg);
    border-radius: 8px;
    min-height: 250px;
    animation: imageLoading 2s linear infinite;
}

/* 图片加载呼吸动画 */
@keyframes imageLoading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* section-image动画显示状态 */
.content-area.animation-ready .section-image {
    opacity: 1;
    transform: translateY(0);
}

.section-image img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 图片加载完成状态 */
.section-image.loaded img {
    opacity: 1;
}

.section-image.loaded {
    background-color: transparent;
    animation: none;
}

.notes {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.notes-icon {
    width: 12px;
    height: 12px;
    margin-right: 2px;
    opacity: 0;
    transition: opacity 0.2s linear;
    will-change: opacity;
}

/* .notes-icon 动画现在由JavaScript控制，移除CSS动画 */

.notes p {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-single-sm);
    color: var(--text-color-tertiary);
}

/* 表格样式 */
.grid-table {
    display: grid;
    width: inherit;
    grid-template-columns: var(--col-template);
    gap: var(--spacing-gap-5x);
    margin-bottom: var(--spacing-gap-5x);
    margin-top: var(--spacing-gap-8x);
}

.cell-header {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);
}

.cell-divider {
    width: 100%;
    grid-column: 1 / -1;   /* 横跨所有列 */
    height: 1px;
    background-color: var(--fill-color-divider);
    margin: 0;
    opacity: 0;
    transition: opacity 0.2s linear;
}

.cell-value {
    /*display: inline-flex;
    align-items: center;*/
    font-family: var(--font-family-figure);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);
    word-wrap: break-word;      /* 旧属性，兼容性好 */
    overflow-wrap: break-word;  /* 推荐使用，现代标准 */
    word-break: break-all;      /* 强制在任意位置断行 */
}

.cell-text {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);
}

.cell-text-44 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 22px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-text-36 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 18px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-text-30 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-text-26 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-text-24 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-text-20 {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family-body);
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);   
}

.cell-icon {
    line-height: var(--font-line-height-multi-sm);
}

.availabilty {
    width: 18px;
    height: 18px;
}

.cell-inline-icon {
    width: 16px;
    height: 16px;
}

.cell-color {
    width: 22px;
    height: 22px;
    border-radius: 4px;
}


/* 代码块组件样式 */
.code-block {
    position: relative;
    background-color: var(--fill-color-bg);
    border-radius: var(--border-radius-2x);
    width: 100%;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--spacing-gap-4x) var(--spacing-gap-4x) 0 var(--spacing-gap-4x);
}

.code-block-title {
    font-family: var(--font-family-figure);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-single-sm);
    font-weight: var(--font-weight-regular);
    color: var(--text-color-tertiary);
    margin: 0;
}

.code-block-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-top: -12px;
    margin-right: -12px;
    position: relative;
    padding: 0;
}

.code-block-copy-btn img {
    width: 36px;
    height: 36px;
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%);
    transition: opacity 0.15s ease, filter 0.2s linear;
}

.code-block-copy-btn:hover img {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%);
}

.code-block-copy-btn:active img {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%);
}

.code-block-copy-btn .copy-icon {
    opacity: 1;
}

.code-block-copy-btn .done-icon {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    opacity: 0;
    filter: none !important;
}

.code-block-copy-btn.copied .copy-icon {
    opacity: 0;
}

.code-block-copy-btn.copied .done-icon {
    opacity: 1;
}

.code-block-content {
    display: flex;
    margin-top: var(--spacing-gap-2x);
    margin-bottom: var(--spacing-gap-8x);
    padding-left: var(--spacing-gap-2x);
    padding-right: var(--spacing-gap-2x);
}

.code-block-line-numbers {
    font-family: var(--font-family-figure);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-disabled);
    margin-right: var(--spacing-gap-5x);
    text-align: right;
    min-width: 20px;
    user-select: none;
}

.code-block-code {
    flex: 1;
    white-space: pre;
    overflow-x: auto;
    margin: 0;
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.code-block-code::-webkit-scrollbar {
    display: none; /* WebKit */
}

.code-block-code code {
    font-family: var(--font-family-figure);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);
}

.code-key {
    color: #1493FF;
}

.code-string {
    color: #00A56B;
}

/* Prompt内容样式 */
.prompt-content {
    width: 100%;
    margin: 0px;
    font-family: var(--font-family-figure);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-multi-sm);
    color: var(--text-color-primary);
}

.prompt-content p {
    margin-bottom: var(--spacing-gap-8x);
}

.prompt-content p:last-child {
    margin-bottom: 0px;
}

/* 页面导航按钮样式 */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: var(--spacing-gap-20x);
    margin-bottom: 0px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-gap-2x);
    color: var(--text-color-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s linear, filter 0.2s linear;
}

.nav-button-next {
    justify-content: flex-start;
}

.nav-button-previous {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.nav-button-icon {
    width: auto;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%);
    flex-shrink: 0;
}

.nav-button-text {
    font-family: var(--font-family-body);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-regular);
    line-height: var(--font-line-height-single-lg);
    white-space: nowrap;
}

.nav-button-previous .nav-button-text {
    text-align: right;
}

.nav-button:hover,
.nav-button-icon:hover {
    color: var(--text-color-secondary);
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%);
}

.nav-button:active,
.nav-button-icon:active {
    color: var(--text-color-tertiary);
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%);
}

/* 内容索引页脚区 */
.index-sidebar {
    width: 146px;
    height: 100vh;
    /*background: #f5f6f7;*/
    position: fixed;
    right: var(--spacing-gap-11x);
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-gap-11x) 0;
    box-sizing: border-box;
}

.index-header h3 {
    font-family: var(--font-family-body);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--font-line-height-multi-lg);
    color: var(--text-color-primary);
    margin-bottom: var(--spacing-gap-5x);
}

.index-tabs {
    display: flex;
    flex-direction: column;
}

.index-tab {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-single-sm);
    color: var(--text-color-disabled);
    margin-bottom: var(--spacing-gap-2x);
    cursor: pointer;
    transition: color 0.2s linear;
}

.index-tab.active {
    color: var(--text-color-primary);
}

.index-tab:hover,
.index-tab.active:hover {
    color: var(--text-color-secondary);
}

.index-tab:active,
.index-tab.active:active {
    color: var(--text-color-tertiary);
}

.index-footer {
    margin-top: auto;
}

.index-footer p {
    font-family: var(--font-family-body);
    font-size: var(--font-size-sm);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-tertiary);
    margin: 0;
}


/* 菜单浮动按钮 */
.menu-floating-button {
    position: fixed;
    bottom: var(--spacing-gap-11x);
    left: var(--spacing-gap-6x);
    z-index: 1001;
    display: none; /* 默认隐藏，仅在小屏幕显示 */
    width: 48px;
    height: 48px;
    background: var(--fill-color-bg);
    border: none;
    border-radius: var(--border-radius-2x);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97), left 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97);
}

.menu-floating-button.hidden {
    transform: translateY(8px);
    opacity: 0;
    transition: transform 150ms ease-out, opacity 150ms ease-out;
}

.menu-floating-button.visible {
    transform: translateY(0px);
    opacity: 1;
    transition: transform 150ms ease-in, opacity 150ms ease-in;
}

.menu-floating-button img {
    filter: brightness(0) saturate(100%) invert(5%) sepia(10%) saturate(5481%) hue-rotate(196deg) brightness(96%) contrast(96%);
    transition: filter 0.2s linear;
}

.menu-floating-button img:hover {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%);
}

.menu-floating-button img:active {
    filter: brightness(0) saturate(100%) invert(60%) sepia(6%) saturate(629%) hue-rotate(196deg) brightness(96%) contrast(94%);
}

/* 浮动控制按钮 */
.control-floating-button {
    position: fixed;
    bottom: 44px;
    z-index: 1000;
    display: none; /* 默认隐藏 */
    background: var(--fill-color-bg);
    border-radius: var(--border-radius-2x);
    align-items: center;
    justify-content: center;
    height: 52px;
    transform: translateY(0);
    opacity: 1;
}

.control-floating-button.hidden {
    transform: translateY(8px);
    opacity: 0;
    transition: transform 150ms ease-out, opacity 150ms ease-out;
}

.control-floating-button.visible {
    transform: translateY(0px);
    opacity: 1;
    transition: transform 150ms ease-in, opacity 150ms ease-in;
}

.control-floating-button .floating-tab-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-gap-5x);
    margin-left: var(--spacing-gap-5x);
}

.control-floating-button .floating-tab-rule {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-disabled);
    cursor: pointer;
    transition: color 0.2s linear;
    text-align: center;
    margin-right: var(--spacing-gap-2x);
}

.control-floating-button .floating-tab-rule.active {
    color: var(--text-color-primary);
}

.control-floating-button .floating-tab-rule:hover,
.control-floating-button .floating-tab-rule.active:hover {
    color: var(--text-color-secondary);
}

.control-floating-button .floating-tab-rule:active,
.control-floating-button .floating-tab-rule.active:active {
    color: var(--text-color-tertiary);
}

.control-floating-button .floating-tab-separator {
    width: 1px;
    height: 12px;
    background-color: var(--fill-color-tertiary);
}

.control-floating-button .floating-tab-prompt {
    font-family: var(--font-family-body);
    font-size: var(--font-size-md);
    line-height: var(--font-line-height-single-md);
    color: var(--text-color-disabled);
    cursor: pointer;
    transition: color 0.2s linear;
    text-align: center;
    margin-left: var(--spacing-gap-2x);
    position: relative;
}

.control-floating-button .floating-tab-prompt .gradient-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,#fc0011 10%,#f8aeb2 25%,#FFE4DE 50%,#f8aeb2 75%,#fc0011 90%);
    background-size: 500% 500%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    z-index: 1;
}

.control-floating-button .floating-tab-prompt.active {
    color: var(--text-color-primary);
}

.control-floating-button .floating-tab-prompt:hover:not(.active) {
    animation: text-to-secondary 1s linear;
    color: var(--text-color-secondary);
}

.control-floating-button .floating-tab-prompt:hover:not(.active) .gradient-text {
    animation: gradient-to-secondary 1s linear forwards;
}

.control-floating-button .floating-tab-prompt.active:hover {
    color: var(--text-color-secondary);
}

.control-floating-button .floating-tab-prompt:active,
.control-floating-button .floating-tab-prompt.active:active {
    color: var(--text-color-tertiary) !important;
    animation: none !important;
}

.control-floating-button .floating-icon-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-right: var(--spacing-gap-2x);
}

.control-floating-button .floating-icon-button {
    width: 40px;
    height: 40px;
    background-color: var(--fill-color-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s linear, filter 0.2s linear;
}

.control-floating-button .floating-icon-button:hover {
    background-color: var(--fill-color-divider);
}

.control-floating-button .floating-icon-button img:active {
    filter: brightness(0) saturate(100%) invert(40%) sepia(8%) saturate(1158%) hue-rotate(196deg) brightness(95%) contrast(89%);
}

/* ==== 响应式布局 ==== */

/* 超大屏幕 (>=1964px) */
@media (min-width: 1964px) {
    .control-panel {
        left: calc(50% - 146px); /* 内容区左边沿(50%) - 操作栏宽度(102px) - 间距(44px) */
    }
    
    .content-area {
        left: 50%; /* 左边沿在窗口1/2位置 */
        width: calc(50% - 278px); /* 从50%到右侧，减去索引区宽度和间距和右边距 */
        min-width: 704px;
    }
    
    .control-floating-button {
        display: none; /* 大屏幕下隐藏浮动按钮 */
    }
}

/* 大屏幕 (1528px <= w <= 1963px) */
@media (min-width: 1528px) and (max-width: 1963px) {
    .control-panel {
        left: calc(100% - 1128px); /* 页面窗口宽度(100%) - （操作栏宽度+内容区宽度+索引区宽度+间距） */
    }
    
    .content-area {
        left:calc(100% - 982px); /* 页面窗口宽度(100%) - （内容区宽度+索引区宽度+间距） */
        width: 704px; /* 固定宽度 */
    }
    
    .control-floating-button {
        display: none; /* 大屏幕下隐藏浮动按钮 */
    }
}

/* 中屏幕 (1008px <= w <= 1527px) */
@media (min-width: 1008px) and (max-width: 1527px) {
    .control-panel,
    .index-sidebar {
        display: none; /* 隐藏操作栏和索引区 */
    }
    
    .content-area {
        left: 444px;
        width: calc(100% - 400px - 88px); /* 总宽度 - 菜单栏 - 左右边距 */
        right: var(--spacing-gap-11x);
    }
    
    .control-floating-button {
        display: flex; /* 显示浮动按钮 */
        left: calc(444px + (100% - 400px - 88px) / 2); /* content-area左边距 + content-area宽度的一半 */
        transform: translateX(-50%) translateY(0); /* 水平居中 + 初始Y位置 */
    }
    
    .control-floating-button.hidden {
        transform: translateX(-50%) translateY(8px); /* 保持水平居中 + Y轴下移 */
    }
    
    .control-floating-button.visible {
        transform: translateX(-50%) translateY(0px); /* 保持水平居中 + Y轴上移 */
    }
    
    /* 中屏幕下floating-icon-buttons内toast的特殊定位 */
    .floating-icon-buttons .toast {
        right: calc(100%); /* 距离floating-icon-buttons左侧12px */
        background-color: var(--fill-color-bg); /* 添加背景色遮盖floating-tab-container */
        padding-top: var(--spacing-gap-1x); 
        padding-bottom: var(--spacing-gap-1x);
        padding-left: var(--spacing-gap-6x);
        padding-right: var(--spacing-gap-5x);
        transition: opacity 0.3s ease, background-color 0.1s ease-out;
    }
    
    .floating-icon-buttons .toast .toast-text,
    .floating-icon-buttons .toast .toast-icon {
        opacity: 0;
        transition: opacity 0.3s ease 0.2s; /* 延迟0.2s后开始淡入 */
    }
    
    .floating-icon-buttons .toast.show .toast-text,
    .floating-icon-buttons .toast.show .toast-icon {
        opacity: 1;
    }
}

/* 小屏幕 (<=1007px) */
@media (max-width: 1007px) {
    .sidebar {
        display: block;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000;
        background: var(--fill-color-container);
        visibility: hidden; /* 默认隐藏，避免断点变化时的位移 */
        transform: translateX(-400px); /* 默认在窗口外左侧，为展开动画做准备 */
    }
    
    .control-panel,
    .index-sidebar {
        display: none;
    }
    
    .menu-floating-button {
        display: flex; /* 小屏幕下显示菜单按钮 */
    }
    
    .content-area {
        width: calc(100% - 48px); /* 总宽度 - 左右边距24px */
        margin-left: var(--spacing-gap-6x);
        margin-right: var(--spacing-gap-6x);
    }
    
    .control-floating-button {
        display: flex; /* 显示浮动按钮 */
        right: var(--spacing-gap-6x); /* 与content-area右边对齐 */
        left: auto;
        transform: none; /* 移除居中变换 */
    }
    
    .control-floating-button .floating-icon-buttons {
        display: none; /* 小屏幕下隐藏icon按钮 */
    }
    
    /* 菜单展开状态 */
    .app.menu-open .sidebar {
        visibility: visible; /* 显示菜单 */
        transform: translateX(-20px); /* 从左侧进入到正常位置 */
        transition: transform 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97), visibility 0ms 0ms; /* visibility立即显示，transform平滑过渡 */
    }
    
    /* 菜单收起状态的动画 - 只在小屏幕下且菜单曾经展开过时生效 */
    .app.menu-closing .sidebar {
        transform: translateX(-400px);
        transition: transform 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97), visibility 0ms 300ms; /* visibility延迟隐藏 */
    }
    
    .app.menu-open .main-content {
        transform: translateX(380px); /* 右移sidebar宽度 */
        opacity: 0.1 !important; /* 透明度降到0.1 */
        transition: transform 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97), opacity 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97);
    }
    
    .app.menu-open .menu-floating-button {
        left: calc(100vw - 24px - 48px); /* 移动到距离窗口右边24px的位置 */
        transition: left 300ms cubic-bezier(0.42, 0.00, 0.09, 0.97);
    }
}

/* Content Area Text Animation Styles */
.content-area.animation-ready {
    opacity: 1 !important; /* 准备播放动画时显示 */
    visibility: visible !important; /* 双重保险显示 */
}

.content-area .word {
    display: inline-block;
    vertical-align: baseline;
    opacity: 0;
    transform: translateY(12px);
    transition: none;
    /* 渲染优化，确保丝滑动画 */
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* 处理标点符号的特殊情况 */
.content-area .word:empty {
    display: none;
}

/* 确保动画过程中布局稳定 */
.content-area.split-text-processed {
    min-height: 200px; /* 防止布局跳动 */
}
