/* ============================================================
   WST 功能平台公共壳样式 v20261008
   铁律:
   1) 不写任何全局选择器重置(*、html、body 裸规则)——一切规则
      限定在 .wst- 类与 body.wst-dock 上,绝不影响页面自身样式;
   2) CSS 自定义属性全部使用 --wst- 前缀——页面 :root 已定义
      --primary 等裸名变量,裸名会合并覆盖互相污染。
   两种壳模式:
   - dock(body.wst-dock):常驻侧栏,页面以 margin-left 让位;
   - float:左上角悬浮按钮 + 覆盖式抽屉,不触碰页面任何布局,
     用于全视口自布局页面(asr-ws-monitor、rtc-test)。
   ============================================================ */

:root {
    --wst-bg: #0f172a;
    --wst-bg-soft: #1e293b;
    --wst-line: rgba(148, 163, 184, .16);
    --wst-text: #e2e8f0;
    --wst-text-dim: #94a3b8;
    --wst-group: #64748b;
    --wst-accent: #2563eb;
    --wst-accent-soft: rgba(37, 99, 235, .2);
    --wst-ok: #16a34a;
    --wst-err: #dc2626;
    --wst-sidebar-w: 220px;
    --wst-z: 2147483000;
    --wst-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ── dock 模式:页面让位 + 常驻侧栏 ─────────────────────── */

body.wst-dock {
    margin-left: var(--wst-sidebar-w);
}

.wst-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--wst-sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--wst-bg);
    color: var(--wst-text);
    font-family: var(--wst-font);
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 1px 0 0 var(--wst-line);
    z-index: var(--wst-z);
}

.wst-brand {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--wst-line);
}

.wst-brand-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
}

.wst-brand-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--wst-text-dim);
}

.wst-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0 14px;
}

.wst-group {
    margin-top: 12px;
}

.wst-group-title {
    padding: 0 16px 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--wst-group);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.wst-nav a {
    display: block;
    padding: 7px 14px 7px 18px;
    color: var(--wst-text-dim);
    text-decoration: none;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wst-nav a:hover {
    background: var(--wst-bg-soft);
    color: var(--wst-text);
}

.wst-nav a.active {
    background: var(--wst-accent-soft);
    color: #fff;
    border-left-color: var(--wst-accent);
}

.wst-foot {
    border-top: 1px solid var(--wst-line);
    padding: 10px 14px 14px;
}

.wst-foot-label {
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--wst-group);
    letter-spacing: .04em;
}

.wst-foot input {
    box-sizing: border-box;
    width: 100%;
    padding: 7px 9px;
    font-size: 12px;
    font-family: var(--wst-font);
    color: var(--wst-text);
    background: rgba(15, 23, 42, .6);
    border: 1px solid var(--wst-line);
    border-radius: 6px;
    outline: none;
}

.wst-foot input:focus {
    border-color: var(--wst-accent);
}

/* ── float 模式:悬浮按钮 + 覆盖式抽屉 ──────────────────── */

.wst-float-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--wst-z);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    padding: 12px 12px 12px 6px;
    border: none;
    border-radius: 0 999px 999px 0;
    background: var(--wst-accent);
    color: #fff;
    font-family: var(--wst-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 4px 6px 20px rgba(37, 99, 235, .35);
    transition: background .15s ease, padding .18s ease, box-shadow .15s ease;
}

.wst-float-btn .wst-float-label {
    display: inline-block;
    max-width: 0;
    margin-left: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width .18s ease, margin-left .18s ease, opacity .18s ease;
}

/* 特指度 (0,4,1):压过接入页自身的全局 button:hover 规则
   (如 asr-ws-monitor 的 button:hover:not(:disabled) 为 (0,3,1)) */
button.wst-float-btn.wst-float-btn:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: transparent;
    padding-left: 16px;
    box-shadow: 6px 8px 26px rgba(37, 99, 235, .5);
}

.wst-float-btn:hover .wst-float-label {
    max-width: 80px;
    margin-left: 6px;
    opacity: 1;
}

.wst-drawer-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--wst-z);
    display: none;
    background: rgba(2, 6, 23, .45);
}

.wst-drawer-mask.show {
    display: block;
}

.wst-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: var(--wst-z);
    width: 240px;
    display: flex;
    flex-direction: column;
    background: var(--wst-bg);
    color: var(--wst-text);
    font-family: var(--wst-font);
    font-size: 13px;
    line-height: 1.5;
    transform: translateX(-102%);
    transition: transform .18s ease;
    box-shadow: 2px 0 18px rgba(2, 6, 23, .5);
}

.wst-drawer.open {
    transform: translateX(0);
}

/* ── toast(供公共层与后续新页面使用) ──────────────────── */

.wst-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: var(--wst-z);
    max-width: 320px;
    padding: 10px 14px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: var(--wst-font);
    font-size: 13px;
    line-height: 1.5;
    border-radius: 8px;
    border-left: 3px solid var(--wst-accent);
    box-shadow: 0 8px 24px rgba(2, 6, 23, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.wst-toast.show {
    opacity: 1;
}

.wst-toast-ok {
    border-left-color: var(--wst-ok);
}

.wst-toast-err {
    border-left-color: var(--wst-err);
}

/* ── App 登录区(侧栏/抽屉)与登录弹层 ──────────────────── */

.wst-login {
    border-top: 1px solid var(--wst-line);
    padding: 10px 14px 14px;
}

.wst-login-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.wst-login-name {
    font-size: 12px;
    color: var(--wst-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wst-login-btn {
    box-sizing: border-box;
    padding: 5px 12px;
    font-size: 12px;
    font-family: var(--wst-font);
    color: var(--wst-text);
    background: rgba(15, 23, 42, .6);
    border: 1px solid var(--wst-line);
    border-radius: 6px;
    cursor: pointer;
}

.wst-login-btn:hover {
    border-color: var(--wst-accent);
}

.wst-login-btn:disabled {
    opacity: .55;
    cursor: default;
}

.wst-login-submit {
    color: #fff;
    background: var(--wst-accent);
    border-color: var(--wst-accent);
}

.wst-login-dialog {
    box-sizing: border-box;
    width: 268px;
    max-width: calc(100vw - 32px);
    padding: 16px;
    background: var(--wst-bg-soft);
    color: var(--wst-text);
    font-family: var(--wst-font);
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--wst-line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(2, 6, 23, .5);
    z-index: calc(var(--wst-z) + 1);
}

.wst-login-dialog::backdrop {
    background: rgba(2, 6, 23, .45);
}

.wst-login-title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}

.wst-login-field {
    display: block;
    margin-bottom: 10px;
}

.wst-login-field span {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--wst-group);
    letter-spacing: .04em;
}

.wst-login-field input {
    box-sizing: border-box;
    width: 100%;
    padding: 7px 9px;
    font-size: 12px;
    font-family: var(--wst-font);
    color: var(--wst-text);
    background: rgba(15, 23, 42, .6);
    border: 1px solid var(--wst-line);
    border-radius: 6px;
    outline: none;
}

.wst-login-field input:focus {
    border-color: var(--wst-accent);
}

.wst-login-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--wst-text-dim);
    cursor: pointer;
}

.wst-login-error {
    margin-bottom: 10px;
    padding: 7px 9px;
    font-size: 12px;
    color: #fecaca;
    background: rgba(220, 38, 38, .16);
    border: 1px solid rgba(220, 38, 38, .4);
    border-radius: 6px;
}

.wst-login-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
