/*
 * 优象工作平台 — workspace.css
 * 内测版 v0.1.0-beta
 * 仅作用于 body.yx-workspace，不污染其他页面
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --yx-primary:     #4F46E5;
    --yx-primary-10:  #EEF2FF;
    --yx-surface:     #F8FAFC;
    --yx-border:      #E2E8F0;
    --yx-text:        #1E293B;
    --yx-muted:       #64748B;
    --yx-radius:      10px;
    --header-h:       52px;
    --sidebar-w:      216px;
    --sidebar-sm:     60px;
    --tabbar-h:       62px;
}

html, body.yx-workspace {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--yx-text);
    background: var(--yx-surface);
    -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────
   顶部栏
───────────────────────────────────────────────────────── */

.yx-ws-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--yx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.yx-ws-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.yx-ws-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--yx-text);
    font-weight: 700;
    font-size: 15px;
}
.yx-ws-logo a:hover { color: var(--yx-primary); }
.yx-logo-img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}
.yx-beta-badge {
    background: #FEF3C7;
    color: #B45309;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
    letter-spacing: .6px;
    line-height: 18px;
}

.yx-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ─────────────────────────────────────────────────────────
   顶部中间导航栏
───────────────────────────────────────────────────────── */

.yx-header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    padding: 0 16px;
}

/* 普通链接 */
.yx-hnav-link {
    padding: 5px 10px;
    font-size: 13px;
    color: var(--yx-muted);
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.yx-hnav-link:hover {
    color: var(--yx-text);
    background: var(--yx-surface);
}

/* 下拉按钮 */
.yx-hnav-dropdown { position: relative; }
.yx-hnav-dropdown::after {
    content: '';
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    z-index: 1999;
}
.yx-hnav-dropdown:has(.yx-hnav-panel.open)::after { display: block; }
.yx-hnav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 13px;
    color: var(--yx-muted);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.yx-hnav-btn:hover,
.yx-hnav-btn.open {
    color: var(--yx-text);
    background: var(--yx-surface);
}
.yx-hnav-caret {
    transition: transform .2s;
    flex-shrink: 0;
}
.yx-hnav-btn.open .yx-hnav-caret { transform: rotate(180deg); }

/* 下拉面板（通用基础） */
.yx-hnav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--yx-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 6px;
    z-index: 2000;
    min-width: 160px;
}
.yx-hnav-panel.open { display: block; }

/* AI工具扁平面板选项 */
.yx-hnav-panel-item {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--yx-text);
    text-decoration: none;
    border-radius: 6px;
    transition: background .12s;
}
.yx-hnav-panel-item:hover { background: var(--yx-surface); color: var(--yx-primary); }

/* 双栏飞出面板（探索菜单） */
.yx-hnav-panel--dual {
    display: none;
    padding: 0;
    overflow: hidden;
}
.yx-hnav-panel--dual.open { display: flex; }

.yx-hnav-col-left {
    width: 148px;
    flex-shrink: 0;
    padding: 6px;
    border-right: 1px solid var(--yx-border);
    overflow-y: auto;
    max-height: 420px;
}

.yx-hnav-col-right {
    display: none;
    width: 190px;
    padding: 6px;
    overflow-y: auto;
    max-height: 420px;
    background: var(--yx-surface);
}
.yx-hnav-col-right.visible { display: block; }

/* 左栏主条目 */
.yx-hnav-main-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--yx-text);
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .12s, color .12s;
    white-space: nowrap;
}
.yx-hnav-main-item:hover,
.yx-hnav-main-item.active {
    background: var(--yx-primary-10);
    color: var(--yx-primary);
}
.yx-hnav-main-item svg { opacity: .4; flex-shrink: 0; }
.yx-hnav-main-item.active svg { opacity: 1; }

/* 右栏子条目 */
.yx-hnav-sub-group { display: none; }
.yx-hnav-sub-group.active { display: block; }

.yx-hnav-sub-item {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--yx-text);
    text-decoration: none;
    border-radius: 6px;
    transition: background .12s, color .12s;
    white-space: nowrap;
}
.yx-hnav-sub-item:hover { background: #fff; color: var(--yx-primary); }

/* 移动端隐藏导航（用 tab bar 代替） */
@media (max-width: 900px) {
    .yx-header-nav { display: none; }
    body.yx-agent-workspace .yx-header-nav {
        display: flex;
        overflow-x: auto;
        min-width: 0;
        scrollbar-width: none;
    }
    body.yx-agent-workspace .yx-header-nav::-webkit-scrollbar { display: none; }
    body.yx-agent-workspace .yx-hnav-link {
        font-size: 12px;
        padding: 5px 7px;
    }
}

/* 余额胶囊 */
.yx-balance-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    color: #166534;
    font-weight: 600;
}
.yx-balance-pill svg { opacity: .8; }
.yx-recharge-link {
    color: #16A34A;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    border-left: 1px solid #BBF7D0;
    padding-left: 8px;
    margin-left: 4px;
}
.yx-recharge-link:hover { text-decoration: underline; }

/* 语言切换菜单 */
.yx-lang-menu { position: relative; }
.yx-lang-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--yx-muted);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.yx-lang-trigger:hover { background: var(--yx-surface); color: var(--yx-text); }
.yx-lang-trigger.open { background: var(--yx-surface); color: var(--yx-text); }

.yx-lang-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    background: transparent;
    z-index: 2000;
    padding-top: 8px;   /* 间隙内化：鼠标不会离开 langMenu */
}
.yx-lang-panel > .yx-lang-panel-inner {
    background: #fff;
    border: 1px solid var(--yx-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 6px;
}
.yx-lang-panel.open { display: block; }

.yx-lang-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--yx-text);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background .12s, color .12s;
}
.yx-lang-item:hover { background: var(--yx-surface); color: var(--yx-primary); }
.yx-lang-item.active { color: var(--yx-primary); font-weight: 600; background: var(--yx-primary-10); }

/* ── 搜索按钮 ── */
.yx-search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: none; background: transparent;
    border-radius: 8px; cursor: pointer;
    color: var(--yx-text-muted);
    transition: background .12s, color .12s;
}
.yx-search-btn:hover { background: var(--yx-surface); color: var(--yx-text); }

/* ── 搜索模态框（对齐官网样式） ── */
.yx-search-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 20px;
}
.yx-search-modal.is-open { display: flex; }
.yx-search-dialog {
    width: min(720px, 92vw);
    background: #fff;
    border: 1px solid #d1d7dc;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    position: relative;
}
.yx-search-close {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; border-radius: 999px;
    border: 0; background: #f7f9fa; color: #6a6f73;
    cursor: pointer; font-size: 20px; line-height: 1;
    transition: all .15s;
}
.yx-search-close:hover { background: #f3e8ff; color: #a435f0; }
.yx-search-title { font-size: 1rem; font-weight: 700; color: #1c1d1f; margin: 4px 0 12px; }
.yx-search-tabs {
    display: flex; gap: 8px; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 8px;
}
.yx-search-tabs::-webkit-scrollbar { display: none; }
.yx-search-tab {
    border: 1px solid #d1d7dc; background: #fff; color: #6a6f73;
    border-radius: 999px; padding: 8px 14px;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: all .15s;
}
.yx-search-tab:hover { border-color: #a435f0; color: #a435f0; }
.yx-search-tab.active { color: #fff; border-color: #a435f0; background: #a435f0; }
.yx-search-box {
    margin-top: 8px; display: flex; align-items: center; gap: 8px;
    background: #f7f9fa; border: 2px solid #d1d7dc;
    border-radius: 14px; padding: 8px;
    transition: border-color .2s, box-shadow .2s;
}
.yx-search-box:focus-within { border-color: #a435f0; box-shadow: 0 0 0 3px rgba(164,53,240,.12); }
.yx-search-current {
    display: inline-flex; align-items: center; height: 34px; padding: 0 12px;
    border-radius: 999px; background: #f3e8ff; border: 1px solid #a435f0;
    color: #a435f0; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.yx-search-input {
    flex: 1; border: 0; outline: 0; background: transparent;
    color: #1c1d1f; font-size: 15px; height: 40px; min-width: 120px;
}
.yx-search-input::placeholder { color: #b3b3b3; }
.yx-search-submit {
    height: 40px; border: 0; border-radius: 10px; padding: 0 18px;
    background: #a435f0; color: #fff; cursor: pointer;
    font-size: 14px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(164,53,240,.25);
    transition: background .15s;
}
.yx-search-submit:hover { background: #b86ef5; }

/* ── 分享按钮 ── */
.yx-share-menu { position: relative; }
.yx-share-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: none; background: transparent;
    border-radius: 8px; cursor: pointer;
    color: var(--yx-text-muted);
    transition: background .12s, color .12s;
}
.yx-share-btn:hover { background: var(--yx-surface); color: var(--yx-text); }
.yx-share-popup {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 8px;
    z-index: 2100;
    min-width: 300px;
}
.yx-share-popup.open { display: block; }
.yx-share-content {
    background: #fff;
    border: 1px solid var(--yx-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.yx-share-title { font-weight: 600; font-size: 14px; }
.yx-share-url-input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--yx-border);
    border-radius: 6px; font-size: 13px;
    background: var(--yx-surface); color: var(--yx-text);
    box-sizing: border-box;
}
.yx-share-copy-btn {
    padding: 10px 16px;
    background: #a435f0; color: #fff;
    border: none; border-radius: 10px;
    cursor: pointer; font-weight: 600; font-size: 14px;
    transition: background .15s;
    box-shadow: 0 4px 12px rgba(164,53,240,.25);
}
.yx-share-copy-btn:hover { background: #b86ef5; }
.yx-share-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.yx-share-qr-canvas {
    width: 132px; height: 132px;
    border-radius: 8px;
    border: 1px solid var(--yx-border);
    background: #fff; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.yx-share-qr-canvas img, .yx-share-qr-canvas canvas { width: 100% !important; height: 100% !important; display: block; }
.yx-share-qr-download {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; padding: 8px 12px;
    border: 1px solid rgba(164,53,240,.35);
    border-radius: 10px; color: #a435f0;
    text-decoration: none; font-size: 13px; font-weight: 600;
    background: rgba(164,53,240,.06);
    transition: all .15s;
}
.yx-share-qr-download:hover { color: #8710d8; border-color: rgba(135,16,216,.45); background: rgba(164,53,240,.12); }

/* ── 强制隐藏 Google Translate 工具栏 ── */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
#google_translate_element2 { display: none !important; }
body { top: 0 !important; }

/* 用户头像菜单 */
.yx-user-menu {
    position: relative;
}
.yx-user-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    transition: background .15s;
}
.yx-user-trigger:hover { background: var(--yx-surface); }
.yx-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    flex-shrink: 0;
}
.yx-username { display: none; }
.yx-user-caret { display: none; }

/* 用户下拉面板 */
.yx-user-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #fff;
    border: 1px solid var(--yx-border);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    padding: 8px;
    z-index: 2000;
}
.yx-user-panel.open { display: block; }
.yx-user-panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 10px;
}

.yx-user-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 10px;
}
.yx-user-panel-header .yx-avatar {
    width: 40px !important;
    height: 40px !important;
}
.yx-user-panel-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--yx-text);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.yx-user-panel-email {
    font-size: 11px;
    color: var(--yx-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.yx-user-panel-divider {
    height: 1px;
    background: var(--yx-border);
    margin: 4px 0;
}
.yx-user-panel-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--yx-text);
    text-decoration: none;
    border-radius: 7px;
    transition: background .12s, color .12s;
}
.yx-user-panel-item:hover { background: var(--yx-surface); color: var(--yx-primary); }
.yx-user-panel-item svg { opacity: .55; flex-shrink: 0; }
.yx-user-panel-item--danger { color: #EF4444; }
.yx-user-panel-item--danger:hover { background: #FEF2F2; color: #DC2626; }

/* ─────────────────────────────────────────────────────────
   主布局
───────────────────────────────────────────────────────── */

.yx-layout {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0; bottom: 0;
}

/* ─────────────────────────────────────────────────────────
   侧边栏
───────────────────────────────────────────────────────── */

.yx-sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--yx-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: visible;
    transition: width .2s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.yx-sidebar.collapsed {
    width: var(--sidebar-sm);
}

/* 折叠按钮 */
.yx-collapse-btn {
    position: absolute;
    top: 50%;
    right: -14px;
    width: 28px;
    height: 42px;
    padding: 0;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--yx-border);
    border-radius: 999px;
    cursor: pointer;
    color: var(--yx-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(15,23,42,.10);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    line-height: 1;
}
.yx-collapse-btn:hover {
    background: var(--yx-primary-10);
    border-color: #C7D2FE;
    color: var(--yx-primary);
    box-shadow: 0 6px 16px rgba(79,70,229,.16);
}
.yx-sidebar.collapsed .yx-collapse-btn svg { transform: rotate(180deg); }
.yx-collapse-btn svg { transition: transform .2s cubic-bezier(.4,0,.2,1); }

/* 导航列表 */
.yx-nav-list {
    list-style: none;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--yx-border) transparent;
}
.yx-nav-list::-webkit-scrollbar { width: 4px; }
.yx-nav-list::-webkit-scrollbar-thumb { background: var(--yx-border); border-radius: 4px; }

.yx-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--yx-radius);
    cursor: pointer;
    transition: background .15s;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    outline: none;
}
.yx-nav-item:hover { background: var(--yx-surface); }
.yx-nav-item:focus-visible { box-shadow: 0 0 0 2px var(--yx-primary); }
.yx-nav-item.active { background: var(--yx-primary-10); }
.yx-nav-item.active .yx-nav-title { color: var(--yx-primary); }

.yx-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.yx-nav-icon svg { width: 18px; height: 18px; }

.yx-nav-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}
.yx-nav-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--yx-text);
    overflow: hidden;
    text-overflow: ellipsis;
}
.yx-nav-sub {
    font-size: 11px;
    color: var(--yx-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 折叠态：隐藏文字，居中图标 */
.yx-sidebar.collapsed .yx-nav-text { display: none; }
.yx-sidebar.collapsed .yx-nav-item { justify-content: center; padding: 10px; }
.yx-sidebar.collapsed .yx-collapse-btn { right: -14px; }

/* 底部链接 */
.yx-sidebar-bottom {
    border-top: 1px solid var(--yx-border);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.yx-recharge-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--yx-radius);
    text-decoration: none;
    color: var(--yx-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    transition: background .15s, color .15s;
}
.yx-recharge-nav:hover { background: var(--yx-surface); color: var(--yx-primary); }
.yx-recharge-nav svg { flex-shrink: 0; }
.yx-sidebar.collapsed .yx-recharge-nav { justify-content: center; }
.yx-sidebar.collapsed .yx-recharge-nav span { display: none; }

.yx-nav-tooltip {
    position: fixed;
    z-index: 3000;
    min-width: 132px;
    max-width: 220px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(15,23,42,.96);
    color: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.22);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-4px) scale(.98);
    transition: opacity .14s ease, transform .14s ease;
}
.yx-nav-tooltip.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}
.yx-nav-tooltip::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    width: 10px;
    height: 10px;
    background: rgba(15,23,42,.96);
    transform: translateY(-50%) rotate(45deg);
    border-radius: 2px;
}
.yx-nav-tooltip-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}
.yx-nav-tooltip-sub {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255,255,255,.68);
}

/* ─────────────────────────────────────────────────────────
   主内容区 / iframe
───────────────────────────────────────────────────────── */

.yx-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.yx-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--yx-surface);
    z-index: 10;
    gap: 14px;
    color: var(--yx-muted);
    font-size: 13px;
}
.yx-loading.hidden { display: none; }

.yx-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--yx-border);
    border-top-color: var(--yx-primary);
    border-radius: 50%;
    animation: yx-spin .65s linear infinite;
}
@keyframes yx-spin { to { transform: rotate(360deg); } }

.yx-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    transition: opacity .2s;
}
.yx-iframe.loading { opacity: 0; }

body.yx-sketchup-window .yx-loading {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
body.yx-sketchup-window .yx-iframe,
body.yx-sketchup-window .yx-iframe.loading {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ─────────────────────────────────────────────────────────
   移动端底部 Tab Bar
───────────────────────────────────────────────────────── */

.yx-tabbar { display: none; }

@media (max-width: 768px) {
    .yx-sidebar   { display: none; }
    .yx-username  { display: none; }
    .yx-logout    { display: none; }

    .yx-layout {
        bottom: var(--tabbar-h);
    }

    .yx-tabbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: var(--tabbar-h);
        background: #fff;
        border-top: 1px solid var(--yx-border);
        z-index: 1000;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .yx-tabbar::-webkit-scrollbar { display: none; }

    .yx-tab {
        flex: 1;
        min-width: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 4px;
        font-size: 10px;
        color: var(--yx-muted);
        transition: color .15s;
        outline: none;
    }
    .yx-tab.active { color: var(--yx-primary); }
    .yx-tab-icon { display: flex; }
    .yx-tab-icon svg { width: 20px; height: 20px; }
}

body.yx-sketchup-window.yx-compact-window .yx-sidebar { display: none; }
body.yx-sketchup-window.yx-compact-window .yx-layout { bottom: var(--tabbar-h); }
body.yx-sketchup-window.yx-compact-window .yx-tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--tabbar-h);
    background: #fff;
    border-top: 1px solid var(--yx-border);
    z-index: 1000;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body.yx-sketchup-window.yx-compact-window .yx-tabbar::-webkit-scrollbar { display: none; }
body.yx-sketchup-window.yx-compact-window .yx-tab {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    font-size: 10px;
    color: var(--yx-muted);
    transition: color .15s;
    outline: none;
}
body.yx-sketchup-window.yx-compact-window .yx-tab.active { color: var(--yx-primary); }
body.yx-sketchup-window.yx-compact-window .yx-tab-icon { display: flex; }
body.yx-sketchup-window.yx-compact-window .yx-tab-icon svg { width: 20px; height: 20px; }
body.yx-sketchup-window.yx-compact-window .yx-username,
body.yx-sketchup-window.yx-compact-window .yx-logout { display: none; }

/* ─────────────────────────────────────────────────────────
   Toast 通知
───────────────────────────────────────────────────────── */

.yx-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #1E293B;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    transform: translateY(8px);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    max-width: 300px;
    pointer-events: none;
}
.yx-toast.show { opacity: 1; transform: translateY(0); }
.yx-toast.success { background: #166534; }
.yx-toast.error   { background: #991B1B; }

@media (max-width: 768px) {
    .yx-toast {
        bottom: calc(var(--tabbar-h) + 12px);
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* ─────────────────────────────────────────────────────────
   手机尺寸修正：避免顶部品牌和操作按钮挤压换行
───────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    :root {
        --header-h: 48px;
        --tabbar-h: 58px;
    }

    .yx-ws-header {
        padding: 0 8px;
        gap: 8px;
        justify-content: flex-start;
    }

    .yx-ws-logo {
        flex: 0 1 auto;
        min-width: 0;
        gap: 5px;
    }

    .yx-ws-logo a {
        max-width: 104px;
        min-width: 0;
        gap: 5px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .yx-ws-logo a span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .yx-logo-img {
        width: 24px;
        height: 24px;
    }

    .yx-beta-badge {
        flex: none;
        padding: 1px 5px;
        font-size: 9px;
        line-height: 16px;
        letter-spacing: .4px;
    }

    .yx-header-right {
        margin-left: auto;
        gap: 5px;
        min-width: 0;
        flex: 0 0 auto;
    }

    .yx-search-btn,
    .yx-share-btn,
    .yx-user-trigger {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .yx-balance-pill {
        gap: 4px;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .yx-balance-pill svg {
        width: 13px;
        height: 13px;
    }

    .yx-recharge-link {
        padding-left: 6px;
        margin-left: 2px;
        font-size: 12px;
    }

    .yx-lang-menu {
        display: none;
    }

    .yx-tab {
        min-width: 56px;
        padding: 5px 4px;
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    .yx-ws-logo a {
        max-width: 74px;
    }

    .yx-beta-badge,
    .yx-share-menu {
        display: none;
    }

    .yx-balance-pill {
        padding: 4px 7px;
    }
}
