/* Fanxing AI desktop workspace rail */
.workspace-rail {
    --rail-accent: #7c6cff;
    --rail-accent-strong: #9a8cff;
    --rail-cyan: #5fd3ff;
    width: 246px;
    flex: 0 0 246px;
    height: 100vh;
    box-sizing: border-box;
    padding: 15px 12px 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.075);
    background:
        radial-gradient(circle at 50% -8%, rgba(124, 108, 255, 0.11), transparent 31%),
        rgba(11, 12, 18, 0.97);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    color: #f4f2ff;
    position: relative;
    z-index: 84;
}

.workspace-rail::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(154, 140, 255, 0.22), transparent 28%, transparent 72%, rgba(95, 211, 255, 0.12));
    pointer-events: none;
}

.workspace-rail button {
    font-family: inherit;
}

.workspace-rail-header {
    min-height: 55px;
    padding: 0 3px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 9px;
}

.workspace-rail-brand-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(139, 122, 255, 0.34);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #a79aff;
    background: linear-gradient(145deg, rgba(124, 108, 255, 0.19), rgba(95, 211, 255, 0.055));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 7px 24px rgba(92, 75, 210, 0.15);
}

.workspace-rail-brand-icon svg {
    width: 21px;
    height: 21px;
    filter: drop-shadow(0 0 7px rgba(142, 126, 255, 0.5));
}

.workspace-rail-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.workspace-rail-brand-copy strong {
    color: #f8f7ff;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.workspace-rail-brand-copy small {
    color: rgba(205, 202, 225, 0.5);
    font-size: 9px;
    white-space: nowrap;
}

.workspace-rail-online {
    width: 6px;
    height: 6px;
    margin-left: auto;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #7e75ff;
    box-shadow: 0 0 0 4px rgba(126, 117, 255, 0.1), 0 0 11px rgba(126, 117, 255, 0.74);
}

.workspace-rail-card {
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(25, 26, 38, 0.92), rgba(16, 17, 25, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 10px 26px rgba(0, 0, 0, 0.12);
}

.rail-account-card {
    padding: 11px;
    background:
        radial-gradient(circle at 5% 4%, rgba(124, 108, 255, 0.16), transparent 48%),
        linear-gradient(145deg, rgba(26, 26, 40, 0.94), rgba(15, 16, 24, 0.96));
}

.rail-account-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.rail-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 13px;
    font-weight: 750;
    background: linear-gradient(145deg, #8373ff, #5547cb 65%, #3345a9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 5px 16px rgba(89, 70, 211, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.rail-avatar.has-image {
    color: transparent;
}

.rail-account-copy,
.rail-wallet-copy,
.rail-current-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rail-account-copy {
    gap: 3px;
}

.rail-account-copy strong {
    overflow: hidden;
    color: rgba(250, 249, 255, 0.96);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-account-copy small {
    overflow: hidden;
    color: rgba(206, 202, 229, 0.46);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-wallet-row {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.rail-wallet-copy {
    gap: 1px;
}

.rail-wallet-copy small {
    color: rgba(206, 202, 229, 0.43);
    font-size: 9px;
}

.rail-wallet-copy strong {
    color: #eeebff;
    font-size: 15px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.rail-primary-btn {
    height: 28px;
    padding: 0 11px;
    border: 1px solid rgba(155, 139, 255, 0.38);
    border-radius: 8px;
    color: #f7f5ff;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(126, 108, 255, 0.94), rgba(88, 74, 203, 0.94));
    box-shadow: 0 6px 16px rgba(82, 64, 202, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.rail-primary-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 19px rgba(91, 72, 218, 0.31), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.workspace-rail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workspace-rail-section-title {
    min-height: 14px;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(238, 236, 249, 0.68);
    font-size: 10px;
    font-weight: 650;
}

.workspace-rail-section-title small {
    color: rgba(168, 162, 197, 0.31);
    font-size: 7px;
    letter-spacing: 0.12em;
}

.rail-quick-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.rail-quick-action {
    min-width: 0;
    height: 58px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(234, 232, 247, 0.76);
    cursor: pointer;
    text-align: left;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.018), transparent 48%),
        rgba(19, 20, 29, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 5px 16px rgba(0, 0, 0, 0.08);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.rail-quick-action:hover {
    color: #f8f6ff;
    border-color: rgba(137, 120, 255, 0.3);
    background:
        linear-gradient(110deg, rgba(124, 108, 255, 0.12), rgba(71, 111, 171, 0.035)),
        rgba(23, 24, 34, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 20px rgba(0, 0, 0, 0.14);
    transform: translateY(-1px) translateX(1px);
}

.rail-quick-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(143, 129, 246, 0.13);
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #9f93ff;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.08), transparent 45%),
        rgba(124, 108, 255, 0.105);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.rail-quick-icon svg,
.rail-title-icon svg {
    width: 14px;
    height: 14px;
}

.rail-quick-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.rail-quick-copy strong {
    overflow: hidden;
    color: rgba(244, 242, 253, 0.84);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-quick-copy small {
    overflow: hidden;
    color: rgba(187, 181, 211, 0.4);
    font-size: 8px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-quick-arrow {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border-radius: 7px;
    color: rgba(179, 171, 214, 0.35);
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.rail-quick-arrow svg {
    width: 12px;
    height: 12px;
}

.rail-quick-action:hover .rail-quick-arrow {
    color: #afa3ff;
    background: rgba(129, 112, 237, 0.08);
    transform: translateX(2px);
}

.rail-quick-action[data-rail-action="assets"] .rail-quick-icon {
    border-color: rgba(81, 161, 211, 0.14);
    color: #74b8e3;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.08), transparent 45%),
        rgba(70, 139, 190, 0.095);
}

.rail-quick-action[data-rail-action="usage"] .rail-quick-icon {
    border-color: rgba(145, 121, 255, 0.16);
    color: #9d8cff;
    background: radial-gradient(circle at 30% 20%, rgba(137, 108, 255, 0.18), transparent 68%);
}

.rail-current-card {
    padding: 11px;
}

.workspace-rail-card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(244, 242, 255, 0.78);
    font-size: 10px;
    font-weight: 650;
}

.rail-title-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.rail-title-icon-pulse {
    color: #8c7eff;
}

.rail-title-icon-notice {
    color: #68cfff;
}

.rail-ready-badge {
    margin-left: auto;
    padding: 2px 6px;
    border: 1px solid rgba(113, 218, 187, 0.17);
    border-radius: 999px;
    color: #80d8be;
    font-size: 8px;
    font-weight: 550;
    background: rgba(69, 181, 148, 0.07);
}

.rail-ready-badge.is-busy {
    border-color: rgba(141, 125, 255, 0.24);
    color: #b4abff;
    background: rgba(124, 108, 255, 0.11);
}

.rail-current-model {
    margin-top: 10px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(8, 9, 14, 0.34);
}

.rail-model-orb {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(126, 109, 255, 0.2), rgba(64, 170, 235, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.rail-model-orb i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a697ff, #65d5ff);
    box-shadow: 0 0 12px rgba(117, 116, 255, 0.75);
}

.rail-current-copy {
    gap: 3px;
}

.rail-current-copy strong {
    overflow: hidden;
    color: rgba(248, 247, 255, 0.88);
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-current-copy small {
    color: rgba(197, 193, 219, 0.4);
    font-size: 8px;
}

.rail-notice-card {
    width: 100%;
    min-height: 116px;
    flex: 1 1 auto;
    padding: 11px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.rail-notice-card:hover {
    border-color: rgba(111, 191, 247, 0.23);
    background: linear-gradient(145deg, rgba(30, 30, 44, 0.94), rgba(17, 18, 27, 0.97));
}

.rail-notice-arrow {
    margin-left: auto;
    color: rgba(112, 202, 255, 0.46);
    font-size: 13px;
    transition: transform 0.18s ease, color 0.18s ease;
}

.rail-notice-card:hover .rail-notice-arrow {
    color: #7dd3ff;
    transform: translateX(2px);
}

.rail-notice-body {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rail-notice-body strong {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(245, 243, 255, 0.84);
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rail-notice-body > span {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(198, 194, 219, 0.42);
    font-size: 9px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.rail-notice-body small {
    margin-top: 2px;
    color: rgba(157, 152, 181, 0.3);
    font-size: 8px;
}

body.chat-shell.theme-light .workspace-rail {
    border-left-color: rgba(44, 39, 78, 0.09);
    color: #211f32;
    background:
        radial-gradient(circle at 50% -8%, rgba(104, 90, 224, 0.09), transparent 31%),
        rgba(247, 248, 252, 0.98);
}

body.chat-shell.theme-light .workspace-rail::before {
    background: linear-gradient(180deg, rgba(100, 85, 222, 0.18), transparent 30%, transparent 75%, rgba(56, 151, 210, 0.09));
}

body.chat-shell.theme-light .workspace-rail-header {
    border-bottom-color: rgba(44, 39, 78, 0.08);
}

body.chat-shell.theme-light .workspace-rail-brand-icon {
    color: #6c5cdc;
    border-color: rgba(103, 88, 219, 0.19);
    background: linear-gradient(145deg, rgba(112, 96, 224, 0.12), rgba(77, 173, 225, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 7px 20px rgba(87, 69, 189, 0.09);
}

body.chat-shell.theme-light .workspace-rail-brand-copy strong {
    color: #242136;
}

body.chat-shell.theme-light .workspace-rail-brand-copy small,
body.chat-shell.theme-light .rail-account-copy small,
body.chat-shell.theme-light .rail-wallet-copy small,
body.chat-shell.theme-light .rail-current-copy small,
body.chat-shell.theme-light .rail-notice-body > span {
    color: rgba(48, 43, 75, 0.48);
}

body.chat-shell.theme-light .workspace-rail-card {
    border-color: rgba(52, 47, 84, 0.09);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(249, 249, 253, 0.97));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 9px 24px rgba(40, 32, 86, 0.045);
}

body.chat-shell.theme-light .rail-account-card {
    background:
        radial-gradient(circle at 4% 4%, rgba(114, 98, 226, 0.1), transparent 49%),
        linear-gradient(145deg, #ffffff, #f8f8fc);
}

body.chat-shell.theme-light .rail-account-copy strong,
body.chat-shell.theme-light .rail-wallet-copy strong,
body.chat-shell.theme-light .rail-current-copy strong,
body.chat-shell.theme-light .rail-notice-body strong {
    color: #27243a;
}

body.chat-shell.theme-light .rail-wallet-row {
    border-top-color: rgba(52, 47, 84, 0.075);
}

body.chat-shell.theme-light .workspace-rail-section-title,
body.chat-shell.theme-light .workspace-rail-card-title {
    color: rgba(42, 38, 65, 0.67);
}

body.chat-shell.theme-light .workspace-rail-section-title small {
    color: rgba(65, 58, 99, 0.3);
}

body.chat-shell.theme-light .rail-quick-action {
    border-color: rgba(52, 47, 84, 0.08);
    color: rgba(43, 39, 67, 0.68);
    background:
        linear-gradient(120deg, rgba(111, 91, 218, 0.018), transparent 52%),
        rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 5px 17px rgba(47, 39, 90, 0.035);
}

body.chat-shell.theme-light .rail-quick-action:hover {
    color: #332c67;
    border-color: rgba(102, 86, 219, 0.22);
    background: linear-gradient(110deg, rgba(113, 96, 224, 0.075), rgba(255, 255, 255, 0.97));
    box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(52, 42, 104, 0.07);
}

body.chat-shell.theme-light .rail-quick-icon {
    border-color: rgba(105, 89, 215, 0.11);
    color: #6959d7;
    background: rgba(105, 89, 215, 0.075);
}

body.chat-shell.theme-light .rail-quick-copy strong { color: rgba(42, 37, 64, 0.82); }
body.chat-shell.theme-light .rail-quick-copy small { color: rgba(66, 58, 91, 0.42); }
body.chat-shell.theme-light .rail-quick-arrow { color: rgba(74, 65, 106, 0.32); }

body.chat-shell.theme-light .rail-quick-action[data-rail-action="assets"] .rail-quick-icon {
    border-color: rgba(65, 143, 194, 0.12);
    color: #3f8dbc;
    background: rgba(67, 145, 197, 0.07);
}

body.chat-shell.theme-light .rail-quick-action[data-rail-action="usage"] .rail-quick-icon {
    border-color: rgba(112, 89, 211, 0.14);
    color: #7059d3;
    background: rgba(112, 89, 211, 0.07);
}

body.chat-shell.theme-light .rail-current-model {
    border-color: rgba(52, 47, 84, 0.065);
    background: rgba(245, 245, 250, 0.77);
}

body.chat-shell.theme-light .rail-notice-card:hover {
    border-color: rgba(91, 76, 204, 0.18);
    background: linear-gradient(145deg, #fff, #f7f7fc);
}

body.chat-shell.theme-light .rail-notice-body small {
    color: rgba(50, 45, 76, 0.35);
}

/* Keep the existing recharge dialog in the same star-indigo palette. */
body.chat-shell:not(.theme-light) .chat-recharge-tab.active,
body.chat-shell:not(.theme-light) .banner-title,
body.chat-shell:not(.theme-light) .recharge-plan-card.active .plan-icon {
    color: #9a8cff;
}

body.chat-shell:not(.theme-light) .chat-recharge-tab.active::after {
    background: #8979ff;
    box-shadow: 0 0 10px rgba(137, 121, 255, 0.46);
}

body.chat-shell:not(.theme-light) .chat-recharge-banner {
    border-color: rgba(137, 121, 255, 0.18);
    background: rgba(137, 121, 255, 0.07);
}

body.chat-shell:not(.theme-light) .banner-icon {
    color: #fff;
    background: linear-gradient(135deg, #9a8cff, #6757df);
}

body.chat-shell:not(.theme-light) .banner-desc,
body.chat-shell:not(.theme-light) .recharge-plan-card.active .plan-desc {
    color: rgba(175, 163, 255, 0.7);
}

body.chat-shell:not(.theme-light) .recharge-plan-card.active {
    border-color: #8373f4;
    background: rgba(126, 108, 255, 0.09);
    box-shadow: 0 0 14px rgba(114, 94, 230, 0.16);
}

body.chat-shell:not(.theme-light) .btn-recharge-confirm {
    color: #fff;
    background: linear-gradient(135deg, #8e7eff, #6252d7);
}

body.chat-shell:not(.theme-light) .btn-recharge-confirm:hover {
    background: linear-gradient(135deg, #a092ff, #7261e8);
    box-shadow: 0 0 18px rgba(126, 108, 255, 0.34);
}

@media (max-width: 1180px) {
    .workspace-rail {
        display: none;
    }
}

@media (max-height: 720px) and (min-width: 1181px) {
    .workspace-rail {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .workspace-rail-header {
        min-height: 48px;
        padding-bottom: 7px;
    }

    .rail-account-card,
    .rail-current-card,
    .rail-notice-card {
        padding: 9px;
    }

    .rail-quick-action {
        height: 44px;
    }

    .rail-notice-body {
        margin-top: 10px;
    }
}
