/* sysIndex system switcher styles */

/*--- 系统切换器 ---*/
.sys-switcher {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    margin-left: 12px;
    line-height: 49px;
}

.sys-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 4px;
    color: #555 !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    user-select: none;
}

.sys-switcher-btn:hover,
.sys-switcher-btn.open {
    background: rgba(55, 106, 234, 0.08);
    color: #376aea !important;
}

.sys-switcher-arrow {
    font-size: 12px;
    transition: transform 0.15s;
}

.sys-switcher-btn.open .sys-switcher-arrow {
    transform: rotate(180deg);
}

/*右上角 user-menu 默认态：打穿 themes-custom.css (1,2,2) 的蓝色锁定，还原为正文色*/
.theme-default #main-navbar .right-navbar-nav > li > a.user-menu {
    color: #333 !important;
    font-size: 13px !important;
    transition: color 0.12s, background 0.12s;
}

/*默认态 span：与 themes-custom.css #main-navbar .user-menu>span 保持一致*/
.theme-default #main-navbar .right-navbar-nav > li > a.user-menu > span {
    color: #333 !important;
    transition: color 0.12s;
}

/*open 态：a 本身 + span 子元素一起高亮，覆盖 themes-custom.css 的 open 背景色*/
.theme-default #main-navbar .right-navbar-nav > li.dropdown.open > a.user-menu,
.theme-default #main-navbar .right-navbar-nav > li.dropdown.open > a.user-menu:hover,
.theme-default #main-navbar .right-navbar-nav > li.dropdown.open > a.user-menu:focus {
    color: #376aea !important;
    background: rgba(55, 106, 234, 0.08) !important;
}

.theme-default #main-navbar .right-navbar-nav > li.dropdown.open > a.user-menu > span {
    color: #376aea !important;
}

.caret-svg {
    transition: transform 0.15s;
    flex-shrink: 0;
}

.sys-switcher-btn.open .caret-svg,
.open > .user-menu .caret-svg {
    transform: rotate(180deg);
}

/*面板*/
.sys-switcher-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px;
    z-index: var(--z-system-top);
    animation: sysSwitcherFadeIn 0.15s ease-out;
}

.sys-switcher-panel.open {
    display: block;
}

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

.sys-switcher-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    padding: 0 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/*卡片网格*/
.sys-switcher-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sys-switcher-grid > li {
    list-style: none;
}

.sys-switcher-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px !important;
    border-radius: 10px;
    text-decoration: none !important;
    color: #333 !important;
    transition: all 0.2s;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
}

.sys-switcher-card:hover {
    background: #f0f4ff;
    border-color: #d4dffc;
    color: #376aea !important;
    transform: translateY(-1px);
}

.sys-switcher-grid > li.active > .sys-switcher-card {
    background: #eef2ff;
    border-color: #c0cfff;
    color: #376aea !important;
}

.sys-switcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e8eeff 0%, #f0f4ff 100%);
    font-size: 18px;
    color: #376aea;
    flex-shrink: 0;
}

.sys-switcher-grid > li.active .sys-switcher-icon {
    background: linear-gradient(135deg, #376aea 0%, #5b8af5 100%);
    color: #fff;
}

.sys-switcher-card:hover .sys-switcher-icon {
    background: linear-gradient(135deg, #d4dffc 0%, #e8eeff 100%);
}

.sys-switcher-grid > li.active .sys-switcher-card:hover .sys-switcher-icon {
    background: linear-gradient(135deg, #2f5ed6 0%, #4a7af0 100%);
    color: #fff;
}

.sys-switcher-card-name {
    font-size: 12px;
    line-height: 1.3;
    word-break: break-all;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*黑夜模式适配*/
.theme-clean .sys-switcher-btn {
    color: rgba(255, 255, 255, 0.85) !important;
}

.theme-clean .sys-switcher-btn:hover,
.theme-clean .sys-switcher-btn.open {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.theme-clean .sys-switcher-panel {
    background: #2c3444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.theme-clean .sys-switcher-title {
    color: rgba(255, 255, 255, 0.5);
}

.theme-clean .sys-switcher-card {
    color: rgba(255, 255, 255, 0.85) !important;
}

.theme-clean .sys-switcher-card:hover {
    background: rgba(55, 106, 234, 0.15);
    border-color: rgba(55, 106, 234, 0.3);
    color: #7aadff !important;
}

.theme-clean .sys-switcher-grid > li.active > .sys-switcher-card {
    background: rgba(55, 106, 234, 0.2);
    border-color: rgba(55, 106, 234, 0.4);
    color: #7aadff !important;
}

.theme-clean .sys-switcher-icon {
    background: linear-gradient(135deg, rgba(55, 106, 234, 0.2) 0%, rgba(55, 106, 234, 0.1) 100%);
    color: #7aadff;
}

.theme-clean .sys-switcher-grid > li.active .sys-switcher-icon {
    background: linear-gradient(135deg, #376aea 0%, #5b8af5 100%);
    color: #fff;
}

/*--- 系统切换器 END ---*/

#ss-panel {
    display: none;
    position: fixed;
    z-index: 9999;
    width: 680px;
    pointer-events: none;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .04);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s;
}

#ss-arrow {
    position: absolute;
    top: -6px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

.ss-panel__head {
    padding: 12px 14px 8px;
    border-bottom: 1px solid #e4e7ed;
}

.ss-panel__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #fafbfc;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
}

.ss-panel__search-icon {
    color: #909399;
}

#ss-search-input {
    flex: 1;
    color: #303133;
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    background: transparent;
    border: none;
    outline: none;
}

#ss-search-input::placeholder {
    color: #c0c4cc;
}

#ss-search-clear {
    display: none;
    color: #909399;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

#dropdown_button.ss-open .caret-svg {
    transform: rotate(180deg);
}

#ss-body {
    max-height: min(560px, calc(100vh - 200px));
    padding: 14px;
    overflow-y: auto;
}

.ss-group {
    margin-bottom: 14px;
}

.ss-group--last {
    margin-bottom: 0;
}

.ss-group--unknown {
    margin-top: 14px;
}

.ss-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 4px 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e4e7ed;
}

.ss-group-header__bar {
    display: inline-block;
    flex-shrink: 0;
    width: 4px;
    height: 12px;
    background: var(--ss-solid);
    border-radius: 2px;
}

.ss-group-header__title {
    color: #303133;
    font-size: 12px;
    font-weight: 600;
}

.ss-group-header__desc,
.ss-group-header__count {
    color: #909399;
    font-size: 11px;
}

.ss-group-header__count {
    margin-left: auto;
}

.ss-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.ss-tile {
    display: flex;
    position: relative;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all .12s;
}

.ss-tile:hover {
    background: var(--ss-soft);
    border-color: var(--ss-border);
}

.ss-tile__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--ss-soft);
    border-radius: 10px;
    transition: transform .12s;
}

.ss-tile:hover .ss-tile__icon {
    transform: scale(1.05);
}

.ss-tile__text {
    flex: 1;
    min-width: 0;
}

.ss-tile__name {
    margin-bottom: 2px;
    color: #303133;
    font-size: 13.5px;
    font-weight: 500;
    transition: color .12s;
}

.ss-tile:hover .ss-tile__name {
    color: var(--ss-deep);
}

.ss-tile__hint {
    overflow: hidden;
    color: #909399;
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-empty {
    padding: 32px;
    color: #909399;
    font-size: 13px;
    text-align: center;
}

.ss-empty__keyword {
    color: #303133;
}

/* sysIndex system switch shell compatibility styles */
