/* ==========================================================================
   Sidebar（桌面侧栏 + 品牌）
   ========================================================================== */

.sidebar-nav__list {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    width: 100%;
    gap: 8px;
}

.sidebar-nav__item {
    align-self: stretch;
    width: 100%;
}

.sidebar-nav__item > a,
.sidebar-nav__item > .sidebar-nav__group {
    width: 100%;
}

.sidebar {
    width: 248px;
    flex-shrink: 0;
    align-self: flex-start;
    height: 100dvh;
    padding: 26px 18px;
    background: #0b0d13;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    overscroll-behavior: contain;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    display: inline-flex;
    position: sticky;
    top: 0;
    z-index: 20;
    overflow: hidden;
}

.brand {
    align-self: stretch;
    padding: 0 10px;
    justify-content: flex-start;
    align-items: center;
    gap: 11px;
    display: inline-flex;
    flex-shrink: 0;
}

.brand__icon {
    width: 156px;
    height: 38px;
    border-radius: 8.14px;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    background: none;
}

.brand__name {
    display: block;
    width: auto;
    height: 21px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar__label {
    align-self: stretch;
    padding: 6px 0 4px 12px;
    display: flex;
    flex-shrink: 0;
}

.sidebar__label-text {
    color: #676d85;
    font-size: 11px;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 1.54px;
}

.sidebar-nav {
    align-self: stretch;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar-nav__link,
.sidebar-nav__link--active,
button.sidebar-nav__link {
    width: 100%;
    align-self: stretch;
    padding: 11px 13px;
    border-radius: 13px;
    justify-content: flex-start;
    align-items: center;
    gap: 13px;
    display: flex;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, outline-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav__link--active {
    background: linear-gradient(90deg, rgba(138, 107, 255, 0.22) 0%, rgba(39, 215, 230, 0.10) 100%);
    outline: 1px solid rgba(138, 107, 255, 0.30);
    outline-offset: -1px;
    border: none;
}

.sidebar-nav__link--active:hover {
    background: linear-gradient(90deg, rgba(138, 107, 255, 0.28) 0%, rgba(39, 215, 230, 0.14) 100%);
}

.sidebar-nav--has-open .sidebar-nav__item--hot .sidebar-nav__link--active,
.sidebar-nav--has-open .sidebar-nav__item--hot .sidebar-nav__link--active:hover {
    background: transparent;
    outline: none;
}

.sidebar-nav--has-open .sidebar-nav__item--hot .sidebar-nav__text--active {
    color: #a7acc2;
    font-weight: 500;
}

.sidebar-nav__link-content {
    flex: 1 1 0;
    min-width: 0;
    justify-content: flex-start;
    align-items: center;
    gap: 13px;
    display: flex;
}

button.sidebar-nav__link {
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.sidebar-nav__link-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    overflow: hidden;
}

.sidebar-nav__link.sidebar-nav__link--expandable {
    justify-content: space-between;
    gap: 8px;
}

.sidebar-nav__link:hover,
.sidebar-nav__link.sidebar-nav__link--expandable:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav__item--open > .sidebar-nav__group > .sidebar-nav__link--expandable,
.sidebar-nav__item--open > .sidebar-nav__group > .sidebar-nav__link--expandable:hover {
    background: linear-gradient(90deg, rgba(138, 107, 255, 0.22) 0%, rgba(39, 215, 230, 0.10) 100%);
    outline: 1px solid rgba(138, 107, 255, 0.30);
    outline-offset: -1px;
}

.sidebar-nav__item--open > .sidebar-nav__group > .sidebar-nav__link--expandable .sidebar-nav__text {
    color: #eef0f8;
    font-weight: 600;
}

.sidebar-nav__group {
    align-self: stretch;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav__sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    align-self: stretch;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 13px;
}

.sidebar-nav__sublist[hidden] {
    display: none;
}

.sidebar-nav__subitem {
    width: 100%;
}

.sidebar-nav__sub-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
    box-sizing: border-box;
    overflow: hidden;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav__sub-link:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-nav__sub-link--active {
    background: linear-gradient(90deg, rgba(138, 107, 255, 0.18) 0%, rgba(39, 215, 230, 0.08) 100%);
    outline: 1px solid rgba(138, 107, 255, 0.24);
    outline-offset: -1px;
}

.sidebar-nav__sub-link--active:hover {
    background: linear-gradient(90deg, rgba(138, 107, 255, 0.22) 0%, rgba(39, 215, 230, 0.10) 100%);
}

.sidebar-nav__sub-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav__sub-text {
    flex: 1 1 0;
    min-width: 0;
    color: #a7acc2;
    font-size: 14px;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
    transition: color 0.2s ease;
}

.sidebar-nav__sub-link:hover .sidebar-nav__sub-text,
.sidebar-nav__sub-link:focus-visible .sidebar-nav__sub-text {
    color: #8a6bff;
}

.sidebar-nav__sub-link--active .sidebar-nav__sub-text,
.sidebar-nav__sub-link--active:hover .sidebar-nav__sub-text {
    color: #eef0f8;
    font-weight: 600;
}

.nav-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

.nav-chevron-wrap {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-chevron {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.sidebar-nav__item--open .nav-chevron {
    transform: rotate(180deg);
}

.sidebar-nav__text--active {
    color: #eef0f8;
    font-size: 14px;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.sidebar-nav__text {
    color: #a7acc2;
    font-size: 14px;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.sidebar-nav__link:hover .sidebar-nav__text,
.sidebar-nav__link.sidebar-nav__link--expandable:hover .sidebar-nav__text {
    color: #eef0f8;
}

.sidebar__spacer {
    align-self: stretch;
    flex: 0 0 24px;
    min-height: 24px;
}

/* ==========================================================================
   Sidebar — Tablet (min-width: 768px and max-width: 1024px)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        position: sticky;
        top: 0;
        z-index: 30;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        align-content: flex-start;
        padding: 12px 16px;
        gap: 10px 14px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        overflow: visible;
    }

    .sidebar__label,
    .sidebar__spacer {
        display: none;
    }

    .sidebar-nav {
        flex: 1 1 100%;
        min-height: 0;
        overflow: visible;
        padding-right: 0;
    }

    .sidebar-nav__list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .sidebar-nav__item,
    .sidebar-nav__item > a,
    .sidebar-nav__item > .sidebar-nav__group,
    .sidebar-nav__link,
    button.sidebar-nav__link {
        width: auto;
    }

    .sidebar-nav__sublist {
        display: none !important;
    }
}
