/* AINova 全新简洁美观设计风格 - 浅色模式 */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #fcfcfd;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 60px;
    --header-height: 64px;
    --sidebar-bg: #FFFFFF;
    --sidebar-submenu-bg: #F1F5F9;
    --sidebar-text: #2C3E50;
    --sidebar-text-muted: #7F8C8D;
    --sidebar-active-indicator: #4f46e5;
    --border-color: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* 全局样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    /*background-color: var(--bg-color);*/
    /*color: var(--text-main);*/
    font-size: 13px;
    color: #52525b;
    background-color: #f9fafb;
}

/* 顶部导航栏 */
.top-navbar {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}

.top-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #FFFFFF !important;
    background-color: var(--sidebar-bg);
    width: var(--sidebar-width);
    margin-left: -1.5rem;
    /* 抵消 container-fluid 的 padding */
    padding-left: 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body:has(.sidebar.collapsed) .top-navbar .navbar-brand {
    width: var(--sidebar-collapsed-width);
    font-size: 0;
    /* 隐藏文字，只留 Logo 图标（如果有的话） */
}

/* 如果有图片 Logo，折叠时居中 */
.top-navbar .navbar-brand img {
    max-height: 32px;
}

.top-navbar .nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
    padding: 0.5rem 1rem;
}

.top-navbar .nav-link:hover {
    color: var(--primary-color);
}

/* 顶部导航下拉菜单样式优化 */
.top-navbar .dropdown-menu .dropdown-item {
    font-size: 13px;
    padding: 8px 16px;
    color: var(--text-main);
}

.top-navbar .dropdown-menu .dropdown-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.top-navbar .dropdown-menu .dropdown-item i {
    font-size: 14px;
}

/* 顶部导航主菜单区域：与侧边栏宽度对齐 */
.navbar-main-menu {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当侧边栏折叠时，调整主菜单左边距 */
/*body:has(.sidebar.collapsed) .navbar-main-menu {*/
/*    margin-left: var(--sidebar-collapsed-width);*/
/*}*/

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--sidebar-text);
}

/* 折叠后的侧边栏 */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* 折叠按钮 */
.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--sidebar-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background-color: var(--sidebar-active-indicator);
    color: white;
    transform: scale(1.1);
}

/* 菜单链接通用样式 */
#sidebar-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.sidebar .nav-link {
    color: var(--sidebar-text-muted);
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-left: none;
    position: relative;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--sidebar-text-muted);
    transition: color 0.2s;
}

.sidebar .nav-link:hover {
    background-color: #F8FAFC;
    color: var(--sidebar-active-indicator);
}

.sidebar .nav-link:hover i {
    color: var(--sidebar-active-indicator);
}

.sidebar .nav-link.active {
    background-color: #F1F5F9;
    color: var(--sidebar-active-indicator);
}

.sidebar .nav-link.active i {
    color: var(--sidebar-active-indicator);
}

/* 激活或悬停时的右侧指示块 (针对一级菜单) */
.sidebar .menu-parent.active::after,
.sidebar .nav-link:not(.submenu-link).active::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--sidebar-active-indicator);
}

/* 父级菜单 */
.sidebar .menu-parent {
    position: relative;
}

.sidebar .menu-arrow {
    font-size: 10px;
    color: var(--sidebar-text-muted);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 子菜单 */
.sidebar .submenu {
    background-color: var(--sidebar-submenu-bg);
    padding: 5px 0;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* 子菜单垂直线 */
.sidebar .submenu::before {
    content: "";
    position: absolute;
    left: 30px;
    /* 对齐图标中心 */
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #E2E8F0;
}

.sidebar .submenu-link {
    padding-left: 55px !important;
    font-size: 13.5px;
}

/* 子菜单水平线 */
.sidebar .submenu-link::before {
    content: "";
    position: absolute;
    left: 30px;
    top: 50%;
    width: 12px;
    height: 1px;
    background-color: #E2E8F0;
}

/* 子菜单指示点 */
.sidebar .submenu-link::after {
    content: "";
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #CBD5E1;
    transition: all 0.2s;
}

.sidebar .submenu-link:hover::after,
.sidebar .submenu-link.active::after {
    background-color: var(--sidebar-active-indicator);
    box-shadow: 0 0 6px rgba(79, 70, 229, 0.4);
}

/* 子菜单折叠动画 - 移除 transition 以免与 jQuery slideDown 冲突 */
.sidebar .collapse {
    overflow: hidden;
}

.sidebar .collapse:not(.show) {
    height: 0 !important;
}

.sidebar .nav-link .menu-text,
.sidebar .user-info,
.sidebar .menu-arrow {
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

/* 折叠状态下隐藏文本 */
#sidebar.collapsed .menu-text,
#sidebar.collapsed .user-info,
#sidebar.collapsed .menu-arrow {
    opacity: 0;
    width: 0;
    transform: translateX(-10px);
    overflow: hidden;
    pointer-events: none;
}

/* 折叠后的菜单项居中 */
#sidebar.collapsed .nav-link {
    display: flex !important;
    /*flex-direction: column !important;*/
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 0 !important;
    gap: 0 !important;
}

#sidebar.collapsed .nav-link i {
    font-size: 1.25rem !important;
    margin: 0 !important;
}

/* 用户信息卡片 */
.user-card {
    padding: 20px 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background-color: var(--sidebar-bg);
    transition: padding 0.3s ease, justify-content 0.3s ease;
}

#sidebar.collapsed .user-card {
    justify-content: center;
    padding: 12px 0 !important;
    margin-bottom: 0;
}

.user-card .avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: #F1F5F9;
    border: 2px solid #E2E8F0;
    color: var(--sidebar-active-indicator);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-card .user-info {
    flex: 1;
    overflow: hidden;
    transition: opacity 0.2s;
}

.user-card .user-info .fw-semibold {
    color: var(--sidebar-text);
    font-size: 14px;
    margin-bottom: 2px;
}

.user-card .user-info .text-muted {
    color: var(--sidebar-text-muted) !important;
    font-size: 12px;
}

/* 折叠后的用户卡片 - 已废弃，通过基础样式和 collapsed 组合控制 */
/* #sidebar.collapsed .user-card { ... } */

#sidebar.collapsed .user-card .avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin: 0 auto;
    border-width: 2px;
    font-size: 1.2rem;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏折叠时的主内容 */
.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.content-body {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    /*padding: 0.5rem 1.25rem;*/
    /*border-radius: 8px;*/
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* 登录页面专有样式 */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control {
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 社交登录按钮 */
.social-login {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
}

.social-btn:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 浮动二级菜单（PC端折叠和移动端通用） */
.submenu-popup {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1051;
    padding: 0.5rem 0;
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
}

.submenu-popup.show {
    display: block;
}

.submenu-popup a {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background-color 0.2s;
    border-left: none !important;
}

.submenu-popup a:hover {
    background-color: #f8fafc;
}

.submenu-popup a.active {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

/* PC端折叠状态下隐藏传统的子菜单 */
.sidebar.collapsed .collapse {
    display: none !important;
}

/* 响应式适配 */
@media (max-width: 768px) {

    /* 移动端顶部导航栏 */
    .top-navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }

    .top-navbar .container-fluid {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        color: var(--text-main);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0;
    }

    /* 移动端用户信息 */
    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
    }

    .mobile-user-info .avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: #f1f5f9;
        color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-user-info .username {
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    /* 移动端用户下拉菜单 */
    .mobile-user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 0.5rem;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        min-width: 180px;
        display: none;
        z-index: 1051;
    }

    .mobile-user-dropdown.show {
        display: block;
    }

    .mobile-user-dropdown a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 8px 16px; /* 调整padding与PC一致 */
        color: var(--text-main);
        text-decoration: none;
        transition: background-color 0.2s;
        font-size: 13px; /* 调整字体大小与PC一致 */
    }

    .mobile-user-dropdown a:hover {
        background-color: #f8fafc;
    }

    .mobile-user-dropdown a:first-child {
        border-radius: 8px 8px 0 0;
    }

    .mobile-user-dropdown a:last-child {
        border-radius: 0 0 8px 8px;
        color: #ef4444;
    }

    .mobile-user-dropdown hr {
        margin: 0;
        border-color: var(--border-color);
    }

    /* 移动端语言切换按钮 */
    .mobile-lang-switch {
        display: flex;
        align-items: center;
    }

    .mobile-lang-switch .btn {
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 1px solid var(--border-color);
    }

    .mobile-lang-switch .btn i {
        font-size: 1.1rem;
    }

    /* 移动端侧边栏：窄窄模式，只显示图标 */
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-collapsed-width) !important;
        /* 移动端使用窄窄模式，与PC端折叠宽度一致 */
        z-index: 1050;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        padding-top: 0.5rem;
    }

    /* 移动端侧边栏显示状态 */
    .sidebar.show {
        transform: translateX(0);
    }

    /* 隐藏用户信息卡片 */
    .sidebar .user-card {
        display: none;
    }

    /* 移动端侧边栏折叠按钮隐藏 */
    .sidebar-toggle-btn {
        display: none;
    }

    /* 移动端侧边栏菜单项：只显示图标 */
    .sidebar .nav-link {
        justify-content: center;
        padding: 0.75rem 0;
        border-left: none;
        position: relative;
    }

    .sidebar .nav-link i {
        font-size: 1.25rem;
    }

    .sidebar .menu-text,
    .sidebar .menu-arrow {
        display: none !important;
    }

    /* 隐藏传统的子菜单 */
    .sidebar .collapse {
        display: none !important;
    }

    /* 移动端主内容区不留边距 */
    .main-content {
        margin-left: 0 !important;
        padding-top: var(--header-height);
    }

    /* 移动端内容区内边距 */
    .content-body {
        padding: 1rem;
    }

    /* 移动端遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1049;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
}

/* 公告栏样式 */
.announcement-bar {
    /*margin-left: var(--sidebar-width);*/
    margin-top: 2px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* 当侧边栏折叠时，调整公告栏左边距 */
body:has(.sidebar.collapsed) .announcement-bar {
    margin-left: var(--sidebar-collapsed-width);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .announcement-bar {
        margin-left: 0;
    }
}

/* 公告内容样式 */
.announcement-content {
    color: #334155;
    font-weight: 500;
    animation: fadeInSlideIn 0.5s ease-in-out;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

@keyframes fadeInSlideIn {
    from {
        opacity: 0.7;
        transform: translateY(-2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 公告图标样式 */
.announcement-bar i.bi-megaphone {
    color: #f59e0b;
    font-size: 1.1rem;
}

/* 公告内容容器样式 */
.notice-content {
    min-width: 0;
    /* 允许flex项目收缩到其内容的固有尺寸以下 */
    text-align: left;
    flex: 1;
}

/* 面包屑样式优化 */
.page-title-breadcrumb .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.page-title-breadcrumb .breadcrumb .breadcrumb-item {
    color: #64748b;
}

.page-title-breadcrumb .breadcrumb .breadcrumb-item.active {
    color: #475569;
    font-weight: 500;
}

.page-title-breadcrumb .breadcrumb .breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
}

.page-title-breadcrumb .breadcrumb .breadcrumb-item a:hover {
    color: #2563eb;
    text-decoration: underline;
}
.float-left{
    float: left;
    margin-bottom: 10px;
}
.float-right{
    float: right;
    margin-bottom: 10px;
}
.float-right.search{margin-right: 10px;}
.table-bordered{margin-top: 10px;}
/* 右上角艺术字 Logo */
.artistic-logo {
    font-family: 'Brush Script MT', 'Comic Sans MS', cursive; /* 艺术字体 fallback */
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(to right, var(--primary-color), #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
    margin-right: 15px;
    display: inline-block;
    vertical-align: middle;
}

.navbar-brand .artistic-logo {
    margin-right: 0;
}
