/* style.css */

body,
html {
    font-size: 13px;
    margin: 0;
    padding: 0;
}

.container {
    display: grid;
    grid-template-areas:
        'sidebar main main';
    grid-template-columns: 240px 1fr;
    /* grid-template-rows: 60px auto; */
    height: 100vh;
    transition: all 0.5s ease;
}

.container-1 {
    grid-template-areas:
        'sidebar main' !important;
}

.iframe {
    height: calc(100vh - 70px);
    border: 0;
    background-color: rgb(240, 242, 245);
    display: block;
    width: 100%;
}

/* 导航栏中的标签盒子 */
.tagbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 240px - 220px);
    position: relative;
}

.tagbox-scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: #f9fafb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    flex-shrink: 0;
}

.tagbox-scroll-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tagbox-scroll-btn:active {
    transform: scale(0.95);
}

.navbar-tagbox {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.navbar-tagbox::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 原有的tagbox样式（用于兼容） */
.iframetagcontainer {
    background-color: rgb(240, 242, 245);
    display: inline-flex;
    width: 100%;
    height: 40px;
    align-items: end;
    padding-left: 10px;
    padding-right: 10px;
    gap: 4px;
}

/* 侧边栏中的departments选择器样式 */
#departments {
    width: 100%;
    font-size: 13px;
    border: 1px solid #e3e3e3;
    padding: 8px;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

#departments:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

#departments:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#departments option {
    padding: 4px 8px;
    color: #333;
    font-weight: normal;
}

#departments option:checked {
    background-color: #3b82f6;
    color: white;
}

.iframetag {
    background-color: #f8f9fa;
    max-width: 200px;
    min-width: 120px;
    height: 28px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    color: #6b7280;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 4px;
}

.iframetag:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.iframetag.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.iframetag.active svg {
    fill: white;
}

.iframetag.active .leftdiv {
    color: white;
}

.iframetag .leftdiv {
    flex: 1;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iframetag .tag-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.iframetag .tag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.iframetag .tag-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.iframetag.active .tag-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.iframetag svg {
    flex-shrink: 0;
}

.navbar {
    grid-area: nav;
    background-color: rgb(49, 58, 70);
    color: #eeeeee;
    padding: 10px;
    line-height: 50px;
    z-index: 2;
    font-size: 13px;
    cursor: pointer;
    /* 其他样式 */
}

.navbar:hover {
    color: #ffffff;
}

.main-content {
    grid-area: main;
    position: relative;
    z-index: 1;
    padding: 0;
    transition: all 0.5s ease;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.nolink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #8b8b8b;
    text-decoration: none;
    margin: 30px 0 30px 0;
}

.nolink-nocaret {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #3a3a3a;
    text-decoration: none;
    margin: 30px 0 30px 0;
}

.show .nolink {
    margin: 30px 0 30px 0;
}

ul {
    list-style-type: none;
    margin: 0;
    padding-inline: 10px;
}

li {
    list-style-type: none;
    margin: 0;
    padding: 0;
    color: #8d8d8d;
}

.spantag {
    background-color: #0077ff;
    color: #ffffff;
    padding: 2px 4px;
    border-radius: 5px;
    font-size: 10px;
    margin-left: 6px;
}

.tagtext {
    color: #006eff;
}

.tagtext:hover {
    color: #004299;
}

ul li a {
    position: relative;
}

ul ul {
    position: static;
}

ul #green-show.show {
    display: block;
}

ul #red-show.show {
    display: block;
}

ul #yellow-show.show {
    display: block;
}

ul ul li {
    border-bottom: none;
}

ul ul li a dt {
    font-size: 13px;
    padding-left: 14px;
    color: #3a3a3a;
}

ul ul li a dt:hover,
.nolink-nocaret:hover {
    color: #006ce7;
}

span {
    /* align-self: right; */
    margin-left: auto;
    margin-right: 0px
}

ul li a span {
    transition: 0.4s;
}

ul li a div.rotate {
    transform: rotate(-180deg);
}

p {
    margin: 0;
}

.i-container {
    width: 16px;
    margin-right: 26px;
    text-align: center;
}

.logodiv {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 2;
}


.menulist {
    padding-left: 10px;
    text-align: left;
    padding-top: 0;
    margin-top: 0;
    height: calc(100vh - 155px);
    overflow-y: auto;
    margin-bottom: 0px;
    transition: all 0.5s ease;
}

.sidebar {
    grid-area: sidebar;
    background-color: rgb(255, 255, 255);
    /* overflow-y: auto; */
    /* height: calc(100% - 70px - 30px + 20px); */
    /* 100% - (height of logout-div + 2*padding of logout-div) - 2* own apdding */
    transition: width 0.5s ease;
    width: 240px;
    transition: all 0.5s ease;
    z-index: 4;
    /* 其
    他样式 */
}

.collapse-button-main {
    text-align: center;
    color: rgb(49, 58, 70);
    padding-top: 15px;
    padding-left: 48px;
    background-color: #f9fafd;
    text-align: left;
    display: none;
}

.collapse-button-main i:hover {
    cursor: pointer;
}

.collapse-button {
    text-align: right;
    color: white;
}

.collapse-button i:hover {
    cursor: pointer;
}

.sidebar.collapsed .collapse-button {
    display: block;
    padding-left: 5px;
    padding-top: 10px;
    padding-bottom: 20px;
    width: 35px;
    color: white;
}

.sidebar.collapsed {
    padding: 0px;
    width: 0px;
    height: calc(100% - 70px - 10px)
}

.sidebar.collapsed~.logout-div {
    padding: 0px;
    width: 0px;
    height: 40px;
}

.sidebar.collapsed~.logout-div i {
    padding: 0;
    margin-left: 0;
}

.container.collapsed {
    grid-template-columns: 0px 1fr;
}

::-webkit-scrollbar {
    width: 0;
    /* Remove scrollbar space */
    background: transparent;
    /* Optional: just make scrollbar invisible */
}

.sidebar-shadow {
    z-index: 3;
    display: none;
}

svg:hover {
    fill: #0077ff;
}

/* 设置按钮样式 */
.svg-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin: 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.svg-container:hover {
    background-color: #f3f4f6;
}

.svg-container svg {
    transition: all 0.2s ease;
}

.svg-container:hover svg {
    fill: #3b82f6;
}

/* 用户菜单样式 */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 20px 0 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.user-avatar:hover {
    border-color: #3b82f6;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    margin-top: 2px;
    backdrop-filter: blur(10px);
}

.user-menu-container:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px) scale(1);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
}

.dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#username-dropdown {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 6px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    justify-content: flex-start;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #3b82f6;
    transform: translateX(2px);
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item:last-child:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dropdown-item:hover svg {
    color: #3b82f6;
    transform: scale(1.1);
}

.dropdown-item:last-child:hover svg {
    color: #dc2626;
}

.dropdown-item span {
    flex: 1;
    text-align: left;
}

/* @media (max-width: 960px) {
    .sidebar:not(.sidebar.collapsed)~.sidebar-shadow {
        display: block;
    }
} */

/* 
@media (max-width: 1200px) {
    .sidebar {
        display: none;
    }

    .logout-div {
        display: none;
    }

    .sidebar-shadow {
        display: none;
    }

    .container {
        grid-template-areas:
            'main main';
    }

    .collapse-button-main {
        display: block;
    }

} */

/* @media (min-width: 1200px) {
    .collapse-button {
        display: none;
    }

    .sidebar-shadow {
        display: none;
    }
} */

/* 响应式设计 */
@media (max-width: 768px) {
    .iframetag {
        min-width: 100px;
        max-width: 140px;
        font-size: 11px;
    }
    
    .space-between > div:first-child {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tagbox-scroll-btn {
        width: 20px;
        height: 20px;
    }
    
    .tagbox-scroll-btn svg {
        width: 14px;
        height: 14px;
    }
    
    #departments {
        font-size: 12px;
        padding: 6px;
    }
    
    .sidebar div:nth-child(2) {
        margin: 0 15px;
        padding: 12px 0;
    }
}