/* ==========================================
   壮族文化多模态外译语料库 - 组件样式 (门户版)
   ========================================== */

/* ==========================================
   顶部加载进度条（NProgress 风格）
   ========================================== */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-secondary, #c9a84c), var(--color-accent, #e0c675));
    z-index: 99999;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
    border-radius: 0 2px 2px 0;
}

#top-progress-bar.active {
    opacity: 1;
}

#top-progress-bar.complete {
    width: 100% !important;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.5s ease 0.3s;
}

/* ==========================================
   骨架屏组件（Skeleton Screen）
   ========================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* 骨架屏预设尺寸 */
.skeleton-title  { height: 22px; width: 55%; margin-bottom: 12px; }
.skeleton-text   { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-30 { width: 30%; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-thumb  { height: 160px; width: 100%; border-radius: 8px; }
.skeleton-tag    { height: 20px; width: 60px; border-radius: 20px; display: inline-block; }
.skeleton-btn    { height: 36px; width: 80px; border-radius: 6px; }

/* 骨架屏卡片组合 */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* 搜索结果骨架屏 */
.skeleton-result-card {
    padding: 20px 24px;
    border: 1px solid #eee;
    border-top: 3px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* ==========================================
   统一 Loading 加载状态
   ========================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #888);
    gap: 16px;
}

/* 旋转圆圈 */
.loader-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--color-primary, #3a5f70);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 加载点动画 */
.loader-dots {
    display: inline-flex;
    gap: 6px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary, #3a5f70);
    animation: dot-bounce 1.2s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40%            { transform: scale(1);   opacity: 1; }
}

.loading-state p {
    font-size: 0.9rem;
    margin: 0;
    font-family: "SimSun", "Songti SC", serif;
    letter-spacing: 0.5px;
}

/* ==========================================
   空状态组件（Empty State）
   ========================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-secondary, #999);
    gap: 12px;
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 8px;
}

.empty-state h3 {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.empty-state p {
    font-size: 0.85rem;
    margin: 0;
    color: #aaa;
}

/* ==========================================
   图片懒加载淡入动画
   ========================================== */
img[loading="lazy"] {
    transition: opacity 0.4s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==========================================
   页面切换过渡（淡入）
   ========================================== */
.page-transition {
    animation: pageEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   滚动进入动画
   ========================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.animate-on-scroll:nth-child(5) { transition-delay: 320ms; }

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================
   导航栏 (门户风格 - 深红)
   ========================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: var(--color-primary);
    /* 深红色背景 */
    border-bottom: 2px solid var(--color-secondary);
    /* 金色底边 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    height: 82px;
    /* Fixed height: 80px container + 2px border */
    box-sizing: border-box;
    /* Include border in height */
    display: flex;
    align-items: center;
    width: 100%;
    /* 强制navbar独占GPU合成层，防止页面内card-bg-image等GPU层颜色渗入 */
    transform: translateZ(0);
    /* 为navbar建立独立合成上下文，彻底隔绝页面其他元素的渲染污染 */
    isolation: isolate;
}

/* Force vertical scrollbar to prevent layout shift */
html {
    overflow-y: scroll;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Ensure footer sticks to bottom when content is short */
footer {
    margin-top: auto !important;
}

.footer-optimized {
    background-color: #1a1b1e;
    color: #8a8f99;
    padding: 30px 0;
    font-size: 13px;
    text-align: center;
    line-height: 2;
    font-family: 'Microsoft YaHei', sans-serif;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.footer-optimized.loaded {
    opacity: 1;
}
.footer-optimized a {
    color: inherit;
    text-decoration: none;
}
.footer-optimized a:hover {
    text-decoration: underline !important;
    color: #ffffff;
}
.footer-info-line {
    margin-bottom: 5px;
}
.footer-record-line {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.footer-browsers-line {
    font-size: 12px;
    opacity: 0.7;
}
.footer-contact-line {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.8;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
    height: 80px;
    /* 增加高度 */
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    /* 白色Logo文字 */
    text-decoration: none;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-right: 40px;
    /* 增加与导航菜单的间距 */
    flex-shrink: 0;
    /* 防止 logo 被压缩 */
}

.navbar-logo-icon {
    width: 40px;
    height: 40px;
    background: white;
    /* 白色背景 */
    color: var(--color-primary);
    /* 红色图标 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-family: serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.navbar-menu {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

/* ==========================================
   头像组件 - 独立设计
   解决圆形头像被遮挡、填充不完整等问题
   ========================================== */

/* 用户头像/登录按钮容器 */
.navbar-auth {
    /* 固定尺寸：40x40px 圆形 */
    width: 40px;
    height: 40px;
    /* 关键：确保容器是圆形 */
    border-radius: 50%;
    /* 隐藏超出部分（裁剪图片） */
    overflow: hidden;
    /* 初始隐藏，JS 添加 auth-ready 类后显示 */
    opacity: 0;
    /* 不可压缩 */
    flex-shrink: 0;
    /* 相对定位，作为图片的定位参考 */
    position: relative;
    /* 极高的 z-index，确保不被任何元素遮挡 */
    z-index: 99999;
    /* 移除默认样式 */
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    /* 鼠标指针 */
    cursor: pointer;
    /* 过渡效果 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* flex 布局确保图片居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* 移除链接默认样式 */
    text-decoration: none;
}

/* 头像准备就绪（显示状态） */
.navbar-auth.auth-ready {
    opacity: 1;
}

/* 悬停效果 */
.navbar-auth:hover {
    transform: scale(1.1);
}

/* 未登录状态 - 空心人形图标 */
.navbar-auth-login {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.2rem;
}

.navbar-auth-login:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

/* 已登录状态 - 用户头像
 * 使用白色描边环替代边框 */
.navbar-auth-user {
    background: transparent;
    border: none;
    padding: 0;
    /* 白色描边环 */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

/* 头像图片 - 关键修复
 * 使用 position: absolute + 100% 尺寸
 * 确保图片完全覆盖容器，不留任何空白 */
.navbar-auth-user img,
.navbar-auth img {
    /* 绝对定位，填满整个容器 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 填充模式：确保图片填满圆形，可能裁剪两边 */
    object-fit: cover;
    /* 块级显示 */
    display: block;
}

/* 悬停时的描边变化 */
.navbar-auth-user:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(212, 175, 55, 0.4);
}

/* 无头像时的文字头像（后备方案） */
.navbar-auth-user-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
}

.navbar-auth-user:hover {
    /* hover 时改变阴影颜色 */
    box-shadow: 0 0 0 2px var(--color-secondary), 0 0 0 5px rgba(212, 175, 55, 0.4);
}

.navbar-menu a {
    font-weight: 500;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-xs) 0;
    transition: all var(--transition-fast);
    position: relative;
    border-bottom: 2px solid transparent;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: white;
    border-bottom-color: var(--color-secondary);
    /* 金色下划线 */
}

/* Bilingual Navbar Support */
.navbar-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-align: center;
}

.navbar-menu .en-text {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    text-transform: capitalize;
}

/* 移动端汉堡菜单 */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: white;
    /* 白色汉堡菜单 */
}



/* ==========================================
   Mega Menu (首页下拉大菜单 - 层次化架构)
   ========================================== */
.navbar-item-has-mega {
    position: relative;
    /* 限制定位上下文，使菜单跟随父元素 */
}

.navbar-item-has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Mega Menu (Drill-down Style) --- */
/* --- Mega Menu (Compact Side-by-Side) --- */
/* --- Mega Menu (Single Column Click Drill-down) --- */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    /* Small single column width */
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
    z-index: 9991;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* 导航容器 */
.mega-nav-container {
    width: 100%;
    /* No flex here, we show block */
    min-height: 320px;
    /* Force minimum height to prevent cursor dropout */
    padding-bottom: 5px;
}

/* 面板样式 (堆叠显示，由JS控制显隐) */
.mega-panel#megaPanelMain,
.mega-panel#megaPanelSub {
    width: 100%;
    background: #fff;
    padding: 8px 0;
    /* transition: opacity 0.2s; optional */
}

/* 一级导航项按钮样式 */
.mega-nav-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    border-left: 3px solid transparent;
    position: relative;
    color: #333;
}

/* Ensure hover state is visible */
#navbarMenu .mega-nav-item:hover {
    background: #f0f4f8;
    border-left-color: var(--color-primary);
    color: var(--color-primary);
}

/* Arrow: Apply to the item container (absolute), effectively one per item */
.mega-nav-item::after {
    content: '›';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #ccc;
    line-height: 1;
}

#navbarMenu .mega-nav-item:hover::after {
    color: var(--color-primary);
}

.mega-nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: inherit;
    display: block;
    /* Align text naturally */
}

/* Remove span arrow */
.mega-nav-item span::after {
    display: none;
}

.mega-nav-item .en {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

#navbarMenu .mega-nav-item:hover .en {
    color: rgba(139, 26, 26, 0.6);
}

/* 二级面板链接列表 */
.mega-sub-list {
    display: none;
    flex-direction: column;
    gap: 0;
}

/* Link styles */
#navbarMenu .mega-menu a.mega-sub-item-link {
    display: block;
    padding: 10px 20px;
    color: #555 !important;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-bottom: 1px solid #f9f9f9;
    text-align: left !important;
    /* Force left alignment */
}

#navbarMenu .mega-menu a.mega-sub-item-link:hover {
    background: #f0f4f8;
    color: var(--color-primary) !important;
    padding-left: 25px;
    /* Slight indentation on hover */
}

/* Remove Back styles */
.mega-back-btn {
    display: none !important;
}



/* Remove Back styles */
.mega-back-btn {
    display: none !important;
}

/* ==========================================
   门户特定组件
   ========================================== */

/* 1. 顶部Banner区域 */
.portal-banner {
    position: relative;
    height: 420px;
    background-color: #fcf9f2;
    /* 米色底 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e0dcd0;
    overflow: hidden;
}

/* 模拟PPT中的扇子与水墨背景 */
.portal-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle at 60% 50%, rgba(212, 175, 55, 0.15), transparent 60%);
    z-index: 1;
}

.portal-banner::after {
    content: '☁';
    /* 简单的云装饰 */
    position: absolute;
    font-size: 20rem;
    color: rgba(139, 26, 26, 0.03);
    top: -50px;
    left: 10%;
    z-index: 0;
}

.portal-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: var(--spacing-lg);
}

.portal-title-zh {
    font-size: 4rem;
    color: var(--color-primary);
    font-family: var(--font-heading);
    margin-bottom: var(--spacing-xs);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.portal-title-en {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.1em;
    font-weight: 300;
    margin-bottom: var(--spacing-xl);
    border-top: 1px solid rgba(58, 95, 112, 0.3);
    border-bottom: 1px solid rgba(58, 95, 112, 0.3);
    display: inline-block;
    padding: 4px 20px;
}

/* Banner中的搜索框 */
.banner-search {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

/* 2. 快速导航Tab */
.quick-nav-tabs {
    background: white;
    border-bottom: 1px solid #ddd;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.nav-tabs-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.nav-tab {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
    color: var(--color-text-primary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 600;
}

.nav-tab:hover,
.nav-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(139, 26, 26, 0.02);
}

/* 3. 板块标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 1.2em;
    background: var(--color-secondary);
    border-radius: 2px;
}

.section-more {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.section-more:hover {
    color: var(--color-primary);
}

/* 4. 新闻列表 */
.news-list {
    list-style: none;
}

.news-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95rem;
    align-items: baseline;
}

.news-item:last-child {
    border-bottom: none;
}

.news-link {
    color: var(--color-text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: var(--spacing-md);
    position: relative;
    padding-left: 12px;
}

.news-link::before {
    content: '•';
    color: var(--color-secondary);
    position: absolute;
    left: 0;
}

.news-link:hover {
    color: var(--color-primary);
}

.news-date {
    color: #999;
    font-size: 0.85rem;
    font-family: monospace;
}

/* 5. 特色功能卡片 (Video/Term) */
.feature-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms;
}

.feature-box:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
    transform: translateY(-8px) scale(1.01);
}

/* ==========================================
   旧有组件 (保留并微调)
   ========================================== */

/* 搜索框组件 (适配Banner) */
.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 120px;
    font-size: 1.05rem;
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

.search-button {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    padding: 0 1.5rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 2px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-normal);
    letter-spacing: 0.05em;
}

.search-button:hover {
    background: var(--color-primary-light);
}

/* 语料卡片 */
.corpus-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms;
    position: relative;
}

/* 段落卡片：处理富文本浮动元素避免高度塌陷 */
.paragraph-card .paragraph-content {
    display: flow-root;
}

.paragraph-card .paragraph-content * {
    position: static !important;
    float: none !important;
    clear: both;
}

.paragraph-card .paragraph-content img,
.paragraph-card .paragraph-content video {
    max-width: 100%;
    height: auto;
}

.corpus-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.corpus-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-secondary);
    opacity: 0.5;
}

.corpus-card:hover::before {
    opacity: 1;
    background: var(--color-primary);
}

.corpus-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f0f0f0;
    filter: sepia(10%);
    transition: filter 0.3s;
}

.corpus-card:hover .corpus-card-image {
    filter: sepia(0%);
}

.corpus-card-content {
    padding: var(--spacing-md);
}

.corpus-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
}

.corpus-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    border-bottom: 1px dashed #eee;
    padding-bottom: var(--spacing-sm);
}

.corpus-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.corpus-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--spacing-sm);
}

.tag {
    padding: 2px 8px;
    background: #fff;
    border: 1px solid var(--color-secondary);
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--color-secondary);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--color-secondary);
    color: white;
}

/* 文本类标签 (黄色系) */
.tag.type-text {
    border-color: var(--color-label-text);
    color: var(--color-label-text);
}

.tag.type-text:hover {
    background: var(--color-label-text);
    color: white;
}

/* 视觉类标签 (绿色系) */
.tag.type-visual {
    border-color: var(--color-label-visual);
    color: var(--color-label-visual);
}

.tag.type-visual:hover {
    background: var(--color-label-visual);
    color: white;
}

/* 筛选器组件 */
.filter-sidebar {
    background: white;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.filter-section {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.filter-option:hover {
    background: #f9f9f9;
    color: var(--color-primary);
}

/* 统计卡片 */
.stat-card {
    background: white;
    color: var(--color-text-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid #eee;
    border-top: 3px solid var(--color-primary);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.stat-card.secondary {
    border-top-color: var(--color-secondary);
}

.stat-card.secondary .stat-number {
    color: var(--color-secondary-dark);
}

.stat-card.accent {
    border-top-color: var(--color-accent);
}

.stat-card.accent .stat-number {
    color: var(--color-accent);
}

/* 媒体播放器 */
.media-player {
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.audio-player {
    padding: var(--spacing-lg);
    background: #333;
    border-top: 3px solid var(--color-secondary);
}

/* 页脚 - Sticky Footer Implementation */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 82px;
    /* 补偿固定导航栏的高度 */
}

.footer {
    background: #1a1a1a;
    color: #ccc;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: auto;
    /* Push to bottom */
    border-top: 3px solid var(--color-primary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

.footer-section a {
    color: #999;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar-container {
        height: 60px;
        padding: 0 var(--spacing-sm);
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-primary);
        /* 移动端菜单背景变红 */
        flex-direction: column;
        padding: var(--spacing-md);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: var(--shadow-md);
        gap: 0;
    }

    .navbar-menu a {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
    }


    .navbar-menu.active {
        display: flex;
    }

    .navbar-toggle {
        display: flex;
    }

    .portal-banner {
        height: 300px;
    }

    .portal-title-zh {
        font-size: 2.5rem;
    }

    .nav-tabs-container {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 var(--spacing-md);
    }
}

/* 反色高亮样式 */
/* ==========================================
   侧边栏布局 (Sidebar Layout)
   ========================================== */
/* ==========================================
   侧边栏布局 (Sidebar Layout) - Flex Fix
   ========================================== */
.layout-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: start;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-md);
    min-height: 800px;
    position: relative;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 内容区域稳定性 */
.content-area {
    flex: 1;
    /* Take remaining space */
    min-width: 0;
    /* Important for nested flex/grid truncation */
    overflow-x: hidden;
    /* Prevent chart overflow */
    min-height: 500px;
}

.sidebar {
    background: white;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    overflow: hidden;

    /* Fixed Sidebar Behavior */
    position: sticky;
    top: 85px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    /* Grid Item Behavior - Fill Grid Column */
    width: 100%;

    height: auto;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li {
    border-bottom: 1px solid #f9f9f9;
}

.sidebar li:last-child {
    border-bottom: none;
}

.sidebar a {
    display: block;
    padding: 15px 20px;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
    background: #fdfdfd;
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.sidebar a .cn {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.sidebar a .en {
    display: block;
    font-size: 0.8rem;
    color: #999;
    font-weight: 400;
}

.sidebar a:hover .en,
.sidebar a.active .en {
    color: var(--color-primary-light);
}

@media (max-width: 900px) {
    .layout-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-width: 0;
        flex: none;
        margin-bottom: var(--spacing-xl);
    }
}

/* 反色高亮样式 */
.highlight-inverse {
    background-color: var(--color-secondary);
    color: white;
    border-radius: 2px;
    padding: 0 4px;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   高级检索 (CNKI Style)
   ========================================== */
.adv-search-container {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
}

.adv-search-row {
    display: flex;
    align-items: flex-start;
    /* 对齐顶部，防止多行复选框导致居中对齐错乱 */
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.adv-search-operator-col {
    width: 90px;
    flex-shrink: 0;
}

.adv-search-label-col {
    width: 100px;
    flex-shrink: 0;
    font-weight: bold;
    color: var(--color-text-primary);
    padding-top: 8px;
    /* 对齐输入框/首行文字 */
    font-size: 1.05rem;
}

.adv-search-content-col {
    flex: 1;
    min-width: 0;
    /* 允许弹性收缩 */
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 4px;
}

.adv-search-action-col {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 2px;
}

.adv-search-field-select {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fdfdfd;
}

.adv-search-operator-select {
    width: 90px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    font-weight: bold;
    color: var(--color-primary);
}

.adv-search-input {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border 0.3s;
}

.adv-search-input:focus {
    border-color: var(--color-primary);
}

.adv-search-mode-select {
    width: 90px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.adv-search-actions {
    display: flex;
    gap: 8px;
}

.adv-btn-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    color: #666;
}

.adv-btn-circle:hover {
    background: #f0f0f0;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.adv-btn-circle.add {
    color: var(--color-success, #28a745);
}

.adv-btn-circle.add:hover {
    background: #e6f4ea;
    border-color: #28a745;
}

.adv-btn-circle.remove {
    color: var(--color-danger, #dc3545);
}

.adv-btn-circle.remove:hover {
    background: #fee;
    border-color: #dc3545;
}

.adv-search-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 适配现有高级面板中的新样式 */
.adv-filter-row {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 15px;
}

.adv-filter-label {
    width: 100px;
    font-weight: bold;
    color: var(--color-text-primary);
    padding-top: 5px;
}

.adv-filter-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* ==========================================
   加载状态 (Loading States) - 高级视觉效果
   ========================================== */

.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xxl) 0;
    width: 100%;
}

.dual-ring-loader {
    display: inline-block;
    width: 64px;
    height: 64px;
}

.dual-ring-loader:after {
    content: " ";
    display: block;
    width: 48px;
    height: 48px;
    margin: 8px;
    border-radius: 50%;
    border: 4px solid var(--color-primary);
    border-color: var(--color-primary) transparent var(--color-primary) transparent;
    animation: dual-ring-rotation 1.2s linear infinite;
}

.loading-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    font-weight: 500;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes dual-ring-rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==========================================
   详情页统一页头 (Unified Detail Header)
   ========================================== */

.detail-page-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #ddd;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-header-back {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.detail-header-back:hover {
    color: var(--color-primary);
}

.detail-header-title {
    color: #333;
    font-size: 1.6rem;
    margin: 0;
    font-weight: 500;
}

.detail-header-label {
    font-size: 1.4rem;
    color: #ff0000;
    font-weight: bold;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .detail-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
}

/* ==========================================
   通用页面头部 (Shared Page Header)
   ========================================== */

.about-header {
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-xxl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--color-accent);
}

.about-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='30' viewBox='0 0 60 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.about-header h1 {
    color: white !important;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-heading);
    letter-spacing: 0.1em;
}

.about-header .container {
    position: relative;
    z-index: 1;
}

/* Animations Helper */
.fade-in {
    animation: fadeInPage 0.8s ease-out forwards;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ==========================================
   Զѡ (Custom Multi-Select)
   ========================================== */
.custom-multi-select {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.ms-display {
    min-height: 42px;
    padding: 6px 36px 6px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
}

.ms-display:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ms-placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.ms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ms-tag {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.ms-tag:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ms-tag i {
    font-size: 0.7rem;
    cursor: pointer;
    color: #94a3b8;
}

.ms-tag i:hover {
    color: #ef4444;
}

.ms-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.ms-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow: hidden;
    animation: msFadeIn 0.2s ease;
}

@keyframes msFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ms-search {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.ms-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.ms-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ms-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 4px 0;
}

.ms-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #334155;
}

.ms-option:hover {
    background: #f1f5f9;
}

.ms-option.selected {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 500;
}

.ms-option input[type=" checkbox\] {
 width: 16px;
 height: 16px;
 cursor: pointer;
}


/* Dropdown animation refinement */
.ms-dropdown {
    transform-origin: top;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.custom-multi-select .ms-arrow {
    transition: transform 0.3s ease;
}

.ms-dropdown[style*=" display: block\] ~ .ms-arrow {
 transform: translateY(-50%) rotate(180deg);
}


.custom-multi-select.open .ms-arrow {
    transform: translateY(-50%) rotate(180deg);
}


/* Grid layout for registers */
.ms-dropdown {
    width: 600px !important;
    max-width: 90vw;
}

.ms-category {
    padding: 10px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.ms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 8px;
}

.ms-grid .ms-option {
    padding: 8px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 6px;
}

.ms-grid .ms-option:hover {
    background: #eff6ff;
}


/* Refining grid to match Image 2 */
.ms-dropdown {
    width: 800px !important;
    left: 0;
    transform: translateX(0);
}

.ms-grid {
    grid-template-columns: repeat(6, 1fr); /* 6 columns for better spacing */
    background: #fff;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px !important;
}

.ms-option span {
    color: #475569;
    font-size: 13px !important;
}

.ms-category {
    background: #f1f5f9;
    color: #1e293b;
    padding: 8px 15px;
    font-size: 13px;
    border-top: 1px solid #e2e8f0;
}


/* Make checkboxes in multi-select more prominent */
.ms-option input[type=" checkbox\] {
 width: 20px;
 height: 20px;
 accent-color: #3b82f6; /* Modern blue */
 cursor: pointer;
 border-radius: 6px;
 border: 2px solid #cbd5e1;
}

.ms-option span {
 font-size: 1rem;
 color: #1e293b;
 user-select: none;
}

.ms-option:hover {
 background-color: #f8fafc;
}

.ms-option.selected {
 background-color: #f0f7ff;
}


/* Custom Checkbox Styling for Multi-select */
.ms-option input[type=" checkbox\] {
 appearance: none;
 -webkit-appearance: none;
 background-color: #fff;
 margin: 0;
 font: inherit;
 color: #3b82f6;
 width: 20px;
 height: 20px;
 border: 2px solid #cbd5e1;
 border-radius: 6px;
 display: grid;
 place-content: center;
 transition: all 0.1s ease-in-out;
}

.ms-option input[type=\checkbox\]::before {
 content: \\;
 width: 10px;
 height: 10px;
 transform: scale(0);
 transition: 120ms transform ease-in-out;
 box-shadow: inset 1em 1em #3b82f6;
 transform-origin: center;
 clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.ms-option input[type=\checkbox\]:checked {
 border-color: #3b82f6;
 background-color: #eff6ff;
}

.ms-option input[type=\checkbox\]:checked::before {
 transform: scale(1);
}

.ms-option:hover input[type=\checkbox\] {
 border-color: #94a3b8;
}


/* Force dropdown visibility and height */
.ms-dropdown {
    min-height: 100px;
}

.ms-options {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.ms-options::-webkit-scrollbar {
    width: 6px;
}

.ms-options::-webkit-scrollbar-track {
    background: #f8fafc;
}

.ms-options::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* Fix z-index for modal content */
#auditModalContent {
    overflow-y: visible !important; /* Allow dropdown to overflow */
}

.modal-body {
    overflow-y: auto !important; /* Move scrolling to the body container */
    max-height: 80vh;
}


/* Horizontal layout for multi-select options */
.ms-options {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    gap: 10px;
}

.ms-option {
    flex: 0 0 calc(25% - 10px); /* 4 items per row */
    min-width: 150px;
    padding: 8px !important;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.ms-dropdown {
    background: #ffffff !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important;
    border: 1px solid #dbe7f3 !important;
    z-index: 1002 !important;
}

/* Adjust padding for horizontal layout */
.ms-option {
    padding-left: 10px !important; /* Ignore depth for horizontal layout to keep it clean */
}


/* Wider and more solid dropdown */
.ms-dropdown {
    width: 100%;
    min-width: 600px; /* Make it wide enough for horizontal layout */
    max-width: 850px;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

.ms-child-option {
    border-radius: 4px;
    transition: background 0.2s;
}

.ms-child-option:hover {
    background-color: #f1f5f9;
}

.ms-parent-option {
    margin-top: 10px;
}

.ms-parent-option:first-child {
    margin-top: 0;
}


/* Premium Multi-Select Redesign */
.custom-multi-select .ms-display {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #fff;
    padding: 8px 40px 8px 12px;
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.custom-multi-select .ms-display:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.custom-multi-select.open .ms-display {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.ms-tag {
    background: #eff6ff !important;
    color: #1e40af !important;
    border: 1px solid #dbeafe !important;
    border-radius: 8px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    animation: tagAppear 0.2s ease-out;
}

@keyframes tagAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ms-tag i {
    color: #93c5fd;
    transition: color 0.2s;
}

.ms-tag i:hover {
    color: #ef4444;
}

.ms-placeholder {
    color: #94a3b8 !important;
    font-size: 14px;
}

.ms-dropdown {
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
    padding: 12px !important;
    margin-top: 8px !important;
    background: #ffffff !important;
}

.ms-options {
    gap: 12px !important;
}

.ms-option {
    border: none !important;
    background: #f8fafc;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    transition: all 0.2s !important;
}

.ms-option:hover {
    background: #f1f5f9 !important;
    transform: translateY(-1px);
}

.ms-option.selected {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

.ms-option.selected span {
    color: #ffffff !important;
}

.ms-option.selected input[type=" checkbox\] {
 border-color: #ffffff;
 background-color: rgba(255,255,255,0.2);
}

.ms-option.selected input[type=\checkbox\]::before {
 box-shadow: inset 1em 1em #ffffff;
}

.ms-parent-option {
 background: transparent !important;
 font-size: 15px;
 color: #64748b;
 margin-top: 15px !important;
 padding-left: 4px !important;
}

.ms-parent-option:hover {
 transform: none !important;
 background: transparent !important;
}

