/* 库存管理二级导航 - 白底金边胶囊风格 */
.inventory-nav-wrapper {
    margin-bottom: 20px;
}

.inventory-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5d5b8;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
    overflow-x: auto;
}

.inventory-nav-item {
    min-width: 120px;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: all .2s ease;
}

.inventory-nav-item:hover {
    color: #b8872f;
    background: #fefbf5;
}

.inventory-nav-item.active {
    color: #111827;
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    border: 1px solid #d97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.inventory-nav-item.active i {
    color: #111827;
}

.inventory-nav-item i {
    color: #9ca3af;
    font-size: 14px;
}

body.ug .inventory-nav {
    direction: rtl;
}

/* 库存页面 Hero 区域 */
.inventory-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.inventory-hero-content {
    flex: 1;
}

.inventory-hero-icon {
    width: 56px;
    height: 56px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.inventory-hero-icon i {
    font-size: 28px;
    color: #fbbf24;
}

.inventory-hero-title {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
}

.inventory-hero-desc {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.6;
    max-width: 500px;
}

.inventory-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.inventory-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
}

.inventory-hero-btn.primary {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    color: #111827;
    border: 1px solid #d97706;
}

.inventory-hero-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.inventory-hero-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.inventory-hero-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.ug .inventory-hero {
    direction: rtl;
}

body.ug .inventory-hero-actions {
    direction: ltr;
}

/* 库存页面容器 */
.inventory-page {
    padding-bottom: 40px;
}

/* ===== 库存模块样式 ===== */

.inventory-page-header {
    margin-bottom: 18px;
}

.inventory-page-title {
    font-size: 26px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 6px;
}

.inventory-page-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
}

.inventory-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.inventory-stat-card {
    background: #fff;
    border: 1px solid #ead8b5;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 22px rgba(17,24,39,.04);
}

.inventory-stat-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.inventory-stat-value {
    margin-top: 8px;
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
    color: #b8872f;
}

.inventory-card {
    background: #fff;
    border: 1px solid #ead8b5;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(17,24,39,.04);
}

.inventory-card-title {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-card-title i {
    color: #c6922e;
}

.inventory-filter-card {
    background: #fff;
    border: 1px solid #ead8b5;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(17,24,39,.04);
}

.inventory-table {
    margin-bottom: 0;
    font-size: 14px;
}

.inventory-table thead th {
    background: #fffaf2 !important;
    color: #374151;
    border-bottom: 1px solid #ead8b5;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}

.inventory-table tbody td,
.inventory-table tfoot td {
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.inventory-table .col-new {
    background-color: #e8f5f3 !important;
    color: #1f2937 !important;
}

.inventory-table .col-old {
    background-color: #faf0e6 !important;
    color: #1f2937 !important;
}

.old-material-weight {
    font-weight: 900;
    color: #b8872f;
}

.inventory-empty {
    border: 1px dashed #d6a141;
    background: #fffaf2;
    border-radius: 16px;
    padding: 36px 20px;
    text-align: center;
    color: #6b7280;
    font-weight: 700;
}

.inventory-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.inventory-primary-btn {
    background: #c6922e !important;
    border-color: #c6922e !important;
    color: #fff !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    height: 44px;
    padding: 0 18px;
}

.inventory-secondary-btn {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    height: 44px;
    padding: 0 18px;
}

.inventory-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fffaf2;
    border: 1px solid #ead8b5;
    color: #b8872f;
    font-size: 12px;
    font-weight: 800;
    margin: 2px;
}

body.ug .inventory-page-header,
body.ug .inventory-card,
body.ug .inventory-filter-card {
    direction: rtl;
}

body.ug .inventory-table {
    direction: rtl;
}

@media (max-width: 768px) {
    .inventory-stat-grid {
        grid-template-columns: 1fr;
    }

    .inventory-card,
    .inventory-filter-card {
        padding: 16px;
    }

    .inventory-page-title {
        font-size: 22px;
    }
}

/* ===== 统一库存管理样式 ===== */

.inventory-page {
    padding: 0;
}

.inventory-subnav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 18px;
    background: #ffffff;
    border: 1px solid #ead8b5;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
    overflow-x: auto;
}

.inventory-subnav-item {
    height: 46px;
    min-width: 132px;
    padding: 0 16px;
    border-radius: 14px;
    color: #4b5563;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    transition: all .18s ease;
}

.inventory-subnav-item i {
    color: #c6922e;
}

.inventory-subnav-item:hover {
    color: #111827;
    background: #fffaf2;
    border-color: #ead8b5;
}

.inventory-subnav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #c6922e, #b8872f);
    border-color: #b8872f;
    box-shadow: 0 8px 18px rgba(198, 146, 46, .22);
}

.inventory-subnav-item.active i {
    color: #ffffff;
}

.inventory-header {
    margin-bottom: 16px;
}

.inventory-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fffaf2 0%, #ffffff 100%);
    border-bottom: 2px solid #ead8b5;
    border-radius: 12px;
}

.inventory-title {
    font-family: "Microsoft YaHei", "Segoe UI", Tahoma, Arial, sans-serif !important;
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
}

.inventory-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 34px !important;
    padding: 0 13px !important;
    border-radius: 10px !important;
    border: 1px solid #d6b25e !important;
    background: #fffaf0 !important;
    color: #7c5600 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    font-family: "Microsoft YaHei", "Segoe UI", Tahoma, Arial, sans-serif !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    width: fit-content !important;
    transition: all 0.2s !important;
}

.inventory-back-btn:link,
.inventory-back-btn:visited,
.inventory-back-btn:hover,
.inventory-back-btn:active,
.inventory-back-btn:focus {
    color: #7c5600 !important;
    text-decoration: none !important;
    background: #fffaf0 !important;
    border: 1px solid #d6b25e !important;
}

.inventory-back-btn:hover {
    background: #fff3cd !important;
    border-color: #c69a2b !important;
    color: #5f4100 !important;
    transform: translateY(-1px);
}

.inventory-back-btn i,
.inventory-back-btn span,
.inventory-back-btn * {
    color: inherit !important;
    text-decoration: none !important;
}

html[lang="ug"] .inventory-title,
body.ug .inventory-title {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif !important;
    line-height: 1.7;
}

html[lang="ug"] .inventory-back-btn,
body.ug .inventory-back-btn {
    font-family: Tahoma, "Segoe UI", Arial, sans-serif !important;
    direction: rtl !important;
    line-height: 1.7 !important;
}

.inventory-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #fffaf2 100%);
    border: 1px solid #ead8b5;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

.inventory-hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.inventory-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #c6922e, #b8872f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.inventory-hero-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 900;
    color: #111827;
}

.inventory-hero-subtitle {
    margin: 6px 0 0 0;
    font-size: 14px;
    color: #6b7280;
}

.inventory-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.inventory-hero-actions .btn {
    border-radius: 12px !important;
    font-weight: 800 !important;
    height: 42px;
    padding: 0 16px;
}

.inventory-card,
.inventory-filter-card {
    background: #ffffff;
    border: 1px solid #ead8b5;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.045);
}

.inventory-card-title {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-card-title i {
    color: #c6922e;
}

.inventory-table {
    margin-bottom: 0;
    font-size: 14px;
}

.inventory-table thead th {
    background: #111827 !important;
    color: #fff !important;
    border: none !important;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    font-weight: 800;
}

.inventory-table tbody td,
.inventory-table tfoot td {
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid #f1eadc;
}

.inventory-table tbody tr:hover {
    background: #fffaf2;
}

.inventory-table .btn {
    border-radius: 10px !important;
    font-weight: 700;
}

.inventory-empty {
    border: 1px dashed #d6a141;
    background: #fffaf2;
    border-radius: 16px;
    padding: 34px 20px;
    text-align: center;
    color: #6b7280;
    font-weight: 700;
}

body.ug .inventory-subnav,
body.ug .inventory-hero,
body.ug .inventory-card,
body.ug .inventory-filter-card {
    direction: rtl;
}

@media (max-width: 992px) {
    .inventory-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .inventory-hero {
        padding: 18px;
    }

    .inventory-hero-title {
        font-size: 22px;
    }

    .inventory-subnav-item {
        min-width: 120px;
    }
}

/* 应用框架全局样式 */

:root {
    --color-dark-bg: #0E1116;
    --color-deep-gold: #B8872F;
    --color-gold: #C6922E;
    --color-light-gold: #F7E7B2;
    --color-page-bg: #F8F4EC;
    --color-card-bg: #FFFFFF;
    --color-main-text: #1F2933;
    --color-secondary-text: #6B7280;
    --color-success: #22C55E;
    --color-error: #EF4444;
}

/* 应用外壳 */
.app-shell {
    display: flex;
    height: 100vh;
    background: var(--color-page-bg);
}

/* 侧边栏容器 */
.app-sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #0F1419 0%, #1A1F2E 100%);
    color: #E8E8E8;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

body.ug .app-sidebar {
    left: auto;
    right: 0;
}

/* 品牌区域 */
.brand-area {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 72px;
}

.brand-content {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-deep-gold) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.brand-text {
    text-align: left;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 2px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--color-light-gold);
    letter-spacing: 1px;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px;
    min-height: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
    height: 0;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}
.sidebar-nav::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}
.sidebar-nav::-webkit-scrollbar-corner {
    background: transparent;
}

/* 菜单组 */
.menu-group {
    margin-bottom: 24px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.menu-group-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-light-gold);
    text-transform: uppercase;
    padding: 0 16px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    width: 100%;
    box-sizing: border-box;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 0;
    color: #C9C9C9;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 15px;
    cursor: pointer;
    height: 44px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.menu-item i {
    width: 20px;
    font-size: 16px;
    flex-shrink: 0;
    text-align: center;
}

.menu-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item:hover {
    background: rgba(198, 146, 46, 0.15);
    color: var(--color-gold);
}

.menu-item.active {
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-deep-gold) 100%);
    color: #FFFFFF;
}

/* 侧边栏底部版本卡片 */
.sidebar-version-card {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(198, 146, 46, 0.08);
    margin: 12px;
    border-radius: 8px;
    height: 58px;
}

.version-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-version-card .version-icon {
    font-size: 20px;
    color: var(--color-gold);
    flex-shrink: 0;
}

.sidebar-version-card .version-text {
    text-align: left;
}

.sidebar-version-card .version-title {
    color: #C9C9C9;
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 2px;
}

.sidebar-version-card .version-number {
    font-size: 11px;
    color: var(--color-light-gold);
}

/* 主内容区 */
.app-main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.ug .app-main {
    margin-left: 0;
    margin-right: 280px;
}

/* 顶部导航栏 */
.app-topbar {
    background: var(--color-card-bg);
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    height: 64px;
}

.page-title-area .page-title-line {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title-area h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-main-text);
    margin: 0;
}

.page-title-area p {
    font-size: 13px;
    color: var(--color-secondary-text);
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* 通知铃铛 */
.topbar-notification {
    position: relative;
    font-size: 18px;
    color: var(--color-secondary-text);
    cursor: pointer;
    transition: color 0.25s;
}

.topbar-notification:hover {
    color: var(--color-gold);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-error);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* 店铺下拉卡片 */
.topbar-store {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F9FAFB;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-main-text);
    transition: all 0.25s;
}

.topbar-store:hover {
    border-color: var(--color-gold);
    background: linear-gradient(90deg, rgba(198, 146, 46, 0.05) 0%, rgba(198, 146, 46, 0.02) 100%);
}

.topbar-store i {
    font-size: 14px;
}

body.ug .topbar-store {
    flex-direction: row-reverse;
}

/* 语言切换 */
.lang-switch {
    display: flex;
    gap: 4px;
}

.lang-switch form {
    display: inline;
}

.lang-switch button {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-secondary-text);
    cursor: pointer;
    transition: all 0.25s;
}

.lang-switch button:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.lang-switch button.active {
    background: var(--color-gold);
    color: white;
    border-color: var(--color-gold);
}

/* 用户信息 */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-deep-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-main-text);
}

.user-role {
    font-size: 11px;
    color: var(--color-secondary-text);
}

body.ug .topbar-user {
    flex-direction: row-reverse;
}

/* 内容区 */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 36px 36px 0 36px;
    background: var(--color-page-bg);
    display: flex;
    flex-direction: column;
}

/* 页脚备案 */
.site-footer {
    padding: 6px 36px 8px 36px;
    background: var(--color-page-bg);
    flex-shrink: 0;
    border-top: 1px solid rgba(184, 148, 62, 0.12);
}
.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.site-footer-beian {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
    transition: color 0.15s;
}
.site-footer-beian:hover {
    color: #b8943e;
    text-decoration: none;
}
.site-footer-beian i {
    font-size: 11px;
    opacity: 0.85;
}
/* 维语下备案信息保持中文 LTR，不跟随 RTL */
body.ug .site-footer-beian {
    direction: ltr;
    text-align: left;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* 消息提示 */
.app-content .alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #7F1D1D;
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 240px;
    }

    body.ug .app-sidebar {
        transform: translateX(100%);
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    body.ug .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    body.ug .app-main {
        margin-right: 0;
    }

    .app-topbar {
        padding: 12px 20px;
        height: auto;
    }

    .app-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 220px;
    }

    .app-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .topbar-actions {
        width: 100%;
        gap: 16px;
    }
}

/* ============ 紧凑布局样式 ============ */
.compact-brand {
    height: 78px !important;
    padding: 14px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.compact-brand .brand-logo {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8a136, #b9821f);
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-brand .brand-logo i {
    font-size: 24px !important;
    color: #fff;
}

.compact-brand .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.compact-brand .brand-title {
    font-size: 18px !important;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.compact-brand .brand-subtitle {
    font-size: 11px !important;
    letter-spacing: 1.4px;
    color: #f6dfaa;
    margin-top: 5px;
    white-space: nowrap;
}

.sidebar-nav .nav-link,
.app-sidebar .nav-link {
    min-height: 46px !important;
    height: 46px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
}

.sidebar-nav .nav-group-title,
.app-sidebar .nav-group-title {
    font-size: 12px !important;
    margin: 18px 16px 8px !important;
}

.compact-version {
    height: 68px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.compact-version .version-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: rgba(198,146,46,.15);
    color: #c6922e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-version .version-text {
    font-size: 12px;
    line-height: 1.35;
}

.compact-title {
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    white-space: nowrap;
}

.compact-title h1 {
    font-size: 24px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.compact-title p {
    font-size: 13px !important;
    margin: 0 !important;
    color: #6b7280;
}

.title-divider {
    color: #c6922e;
    font-weight: 700;
}

.app-topbar {
    min-height: 64px !important;
    height: 64px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ===== 全局紧凑高级版：接近 80% 浏览器缩放观感 ===== */
body {
    font-size: 14px;
}

.app-main,
.main-content,
.content-wrapper {
    font-size: 14px;
}

.topbar,
.app-topbar,
.header-bar {
    min-height: 64px !important;
    height: 64px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.topbar h1,
.app-topbar h1,
.page-title {
    font-size: 24px !important;
    line-height: 1.2 !important;
}

.topbar .subtitle,
.app-topbar .subtitle,
.page-subtitle {
    font-size: 13px !important;
}

.sidebar,
.app-sidebar {
    font-size: 14px !important;
}

.sidebar .nav-link,
.app-sidebar .nav-link,
.sidebar-menu a {
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
}

.sidebar .brand-title,
.app-sidebar .brand-title {
    font-size: 18px !important;
}

.sidebar .brand-subtitle,
.app-sidebar .brand-subtitle {
    font-size: 11px !important;
}

.card,
.sales-card,
.inventory-card,
.inventory-filter-card {
    border-radius: 16px !important;
}

.btn {
    font-size: 14px !important;
    border-radius: 10px !important;
}

.form-control,
.form-select,
select,
input {
    font-size: 14px !important;
}

table {
    font-size: 14px !important;
}

.table th,
.table td {
    padding: 10px 12px !important;
}

/* ===== 库存模块紧凑版 ===== */
.inventory-page {
    max-width: 100%;
}

.inventory-subnav {
    padding: 6px !important;
    margin-bottom: 14px !important;
    border-radius: 16px !important;
    gap: 8px !important;
}

.inventory-subnav-item {
    height: 40px !important;
    min-width: 118px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    gap: 6px !important;
}

.inventory-subnav-item i {
    font-size: 14px !important;
}

.inventory-hero {
    padding: 16px 20px !important;
    margin-bottom: 14px !important;
    border-radius: 18px !important;
    min-height: auto !important;
}

.inventory-hero-main {
    gap: 0 !important;
}

.inventory-hero-title {
    font-size: 24px !important;
    line-height: 1.15 !important;
    margin-bottom: 4px !important;
}

.inventory-hero-subtitle {
    font-size: 13px !important;
    line-height: 1.45 !important;
    margin-top: 4px !important;
    color: #6b7280 !important;
}

.inventory-hero-actions {
    gap: 8px !important;
}

.inventory-hero-actions .btn {
    height: 38px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border-radius: 11px !important;
}

.inventory-card,
.inventory-filter-card {
    padding: 16px !important;
    margin-bottom: 14px !important;
    border-radius: 18px !important;
}

.inventory-card-title {
    font-size: 16px !important;
    margin-bottom: 12px !important;
}

.inventory-table {
    font-size: 13px !important;
}

.inventory-table thead th {
    padding: 10px 10px !important;
    font-size: 13px !important;
}

.inventory-table tbody td,
.inventory-table tfoot td {
    padding: 9px 10px !important;
    font-size: 13px !important;
}

.inventory-table .btn {
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    border-radius: 9px !important;
}

/* ===== 去掉库存标题旁边的大图标 ===== */
.inventory-hero-icon {
    display: none !important;
}

/* 库存模块按钮统一黑金风格 */
.inventory-page .btn-primary,
.inventory-hero-actions .btn-primary {
    background: linear-gradient(135deg, #c6922e, #b8872f) !important;
    border-color: #b8872f !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(198, 146, 46, .18) !important;
}

.inventory-page .btn-success,
.inventory-hero-actions .btn-success {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.inventory-page .btn-secondary,
.inventory-hero-actions .btn-secondary {
    background: #ffffff !important;
    border: 1px solid #d6a141 !important;
    color: #8a641f !important;
    box-shadow: none !important;
}

.inventory-page .btn-info,
.inventory-hero-actions .btn-info {
    background: #ffffff !important;
    border: 1px solid #d6a141 !important;
    color: #8a641f !important;
}

.inventory-page .btn-danger {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

.inventory-page .btn:hover,
.inventory-hero-actions .btn:hover {
    filter: brightness(.96);
}

/* ===== 库存模块二次紧凑化 ===== */
.inventory-page {
    font-size: 13px !important;
}

.inventory-subnav {
    padding: 5px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
    gap: 6px !important;
}

.inventory-subnav-item {
    height: 36px !important;
    min-width: 108px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 12.5px !important;
    gap: 5px !important;
}

.inventory-subnav-item i {
    font-size: 13px !important;
}

.inventory-hero {
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
    border-radius: 16px !important;
}

.inventory-hero-title {
    font-size: 21px !important;
    line-height: 1.15 !important;
    margin: 0 0 4px 0 !important;
}

.inventory-hero-subtitle {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.inventory-card,
.inventory-filter-card {
    padding: 14px !important;
    margin-bottom: 12px !important;
    border-radius: 16px !important;
}

.inventory-card-title {
    font-size: 15px !important;
    margin-bottom: 10px !important;
}

.inventory-table {
    font-size: 12.5px !important;
}

.inventory-table thead th {
    padding: 8px 8px !important;
    font-size: 12.5px !important;
}

.inventory-table tbody td,
.inventory-table tfoot td {
    padding: 8px 8px !important;
    font-size: 12.5px !important;
}

.inventory-table .btn {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 9px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

/* ===== 库存顶部操作按钮统一：白底金边 ===== */
.inventory-page .inventory-hero-actions .btn,
.inventory-page .inventory-hero-actions a.btn,
.inventory-page .inventory-hero-actions button.btn {
    background: #ffffff !important;
    border: 1.5px solid #d6a141 !important;
    color: #8a641f !important;
    box-shadow: none !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 14px !important;
    border-radius: 11px !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    vertical-align: middle !important;
}

.inventory-page .inventory-hero-actions .btn i,
.inventory-page .inventory-hero-actions a.btn i,
.inventory-page .inventory-hero-actions button.btn i {
    font-size: 13px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.inventory-page .inventory-hero-actions .btn:hover,
.inventory-page .inventory-hero-actions a.btn:hover,
.inventory-page .inventory-hero-actions button.btn:hover {
    background: #fffaf2 !important;
    border-color: #c6922e !important;
    color: #7a5215 !important;
    filter: none !important;
}

/* 禁止库存顶部按钮继续显示蓝/绿/黑 */
.inventory-page .inventory-hero-actions .btn-primary,
.inventory-page .inventory-hero-actions .btn-success,
.inventory-page .inventory-hero-actions .btn-secondary,
.inventory-page .inventory-hero-actions .btn-info {
    background: #ffffff !important;
    border-color: #d6a141 !important;
    color: #8a641f !important;
}

/* ===== 库存模块按钮垂直居中修复 ===== */
.inventory-page .btn,
.inventory-page a.btn,
.inventory-page button.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.inventory-page .btn i,
.inventory-page a.btn i,
.inventory-page button.btn i {
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 表格里的操作按钮也保持居中，但颜色不要强行改成顶部按钮 */
.inventory-page .inventory-table .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ===== 整体压缩 base 尺寸 ===== */
.app-layout,
.app-main,
.main-content,
.content-wrapper {
    font-size: 13.5px !important;
}

.app-topbar,
.topbar,
.header-bar {
    height: 58px !important;
    min-height: 58px !important;
    padding: 6px 18px !important;
}

.topbar-title-block {
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    min-width: 0 !important;
}

.topbar-main-title {
    font-size: 23px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
}

.topbar-sub-title {
    font-size: 13px !important;
    line-height: 1.2 !important;
    color: #64748b !important;
    white-space: nowrap !important;
}

.app-topbar .btn,
.topbar .btn,
.header-bar .btn {
    height: 34px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.app-topbar .user-avatar,
.topbar .user-avatar,
.header-bar .user-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
}

.app-sidebar,
.sidebar {
    width: 230px !important;
}

.app-main,
.main-content {
    margin-left: 230px !important;
}

/* .sidebar-brand / .sidebar-brand-title 已由 app-layout-extend.css 统一管理，
   此处旧的 min-height/padding/font-size 覆盖已移除以避免与新 Grid 布局冲突。 */

.sidebar-logo,
.brand-logo {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
}

.sidebar-brand-subtitle,
.brand-subtitle {
    font-size: 10.5px !important;
    letter-spacing: 1px !important;
    margin-top: 4px !important;
}

.sidebar-section-title,
.menu-section-title {
    font-size: 12px !important;
    margin: 16px 18px 8px !important;
}

.sidebar-menu a,
.sidebar .nav-link,
.app-sidebar .nav-link {
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.sidebar-menu a i,
.sidebar .nav-link i,
.app-sidebar .nav-link i {
    font-size: 15px !important;
    width: 18px !important;
}

.sidebar-footer,
.app-sidebar-footer {
    padding: 12px 14px !important;
    margin: 12px 12px !important;
    border-radius: 12px !important;
}

.sidebar-footer-title,
.sidebar-footer .title {
    font-size: 12px !important;
}

.sidebar-footer-version,
.sidebar-footer .version {
    font-size: 12px !important;
}

/* ===== 维语版顶部标题分两行 ===== */
body.ug .topbar-title-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
    max-width: 430px !important;
    direction: rtl !important;
    text-align: right !important;
}

body.ug .topbar-main-title {
    font-size: 22px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    max-width: 430px !important;
}

body.ug .topbar-sub-title {
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    max-width: 430px !important;
    color: #64748b !important;
}

body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    gap: 12px !important;
}

body.ug .brand-subtitle,
body.ug .sidebar-brand-subtitle {
    display: none !important;
}

/* 维语 .sidebar-brand / .sidebar-brand-title 旧覆盖已移除，
   新 Grid 布局（Logo 左/标题右）在 app-layout-extend.css 统一管理。 */

/* ===== 修复：顶部页面标题恢复一行显示 ===== */
.topbar-title-block,
body.ug .topbar-title-block {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    max-width: none !important;
    width: auto !important;
    min-width: 0 !important;
    direction: ltr !important;
    text-align: left !important;
    overflow: visible !important;
}

.topbar-main-title,
body.ug .topbar-main-title {
    font-size: 22px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    max-width: none !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.topbar-sub-title,
body.ug .topbar-sub-title {
    font-size: 12.5px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    max-width: none !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    color: #64748b !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.topbar-title-divider,
body.ug .topbar-title-divider {
    display: inline-flex !important;
    align-items: center !important;
    color: #b8872f !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
}

/* ===== 只让维语侧边栏品牌标题两行显示 ===== */
body.ug .ug-sidebar-brand-title {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    direction: rtl !important;
    text-align: right !important;
    max-width: 170px !important;
}

body.ug .ug-sidebar-brand-title span {
    display: block !important;
    white-space: nowrap !important;
}

body.ug .sidebar-brand-subtitle,
body.ug .brand-subtitle {
    display: none !important;
}

/* ===== 统一侧边栏宽度，修复顶部右侧空白 ===== */
:root {
    --sidebar-width-compact: 250px;
}

.app-sidebar,
.sidebar {
    width: var(--sidebar-width-compact) !important;
}

body.ug .app-sidebar,
body.ug .sidebar {
    right: 0 !important;
    left: auto !important;
    width: var(--sidebar-width-compact) !important;
}

body.ug .app-main,
body.ug .main-content,
body.ug .content-wrapper {
    margin-left: 0 !important;
    margin-right: var(--sidebar-width-compact) !important;
    width: calc(100% - var(--sidebar-width-compact)) !important;
    max-width: none !important;
}

body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    left: 0 !important;
    right: var(--sidebar-width-compact) !important;
    width: calc(100% - var(--sidebar-width-compact)) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    direction: ltr !important;
}

/* ===== 最终修复：维语版 topbar 不再二次扣除 sidebar 宽度 ===== */
:root {
    --app-sidebar-width: 250px;
}

/* 维语版：侧边栏固定在右侧 */
body.ug .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: var(--app-sidebar-width) !important;
    height: 100vh !important;
    z-index: 1000 !important;
}

/* 维语版：主内容只在这里给右侧栏让位置 */
body.ug .app-main {
    margin-left: 0 !important;
    margin-right: var(--app-sidebar-width) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* 关键：topbar 在 app-main 内部，只占满 app-main，不再扣 sidebar */
body.ug .app-topbar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    z-index: 900 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    overflow: visible !important;
}

/* 防止旧规则继续影响 topbar */
body.ug .topbar,
body.ug .header-bar {
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* 顶部左侧标题区域：可以缩，但不能挤到右侧按钮 */
body.ug .topbar-title-block,
body.ug .page-title-area {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    direction: ltr !important;
}

/* 维语文字本身 RTL，但不要让整个 topbar RTL */
body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.ug .topbar-main-title {
    font-size: 20px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}

body.ug .topbar-sub-title {
    font-size: 11.5px !important;
    line-height: 1 !important;
    flex: 1 1 auto !important;
}

/* 分隔线 class 兼容 */
body.ug .title-divider,
body.ug .topbar-title-divider {
    flex: 0 0 auto !important;
    color: #b8872f !important;
    font-weight: 900 !important;
}

/* 顶部右侧操作区固定宽度，不允许被标题压住 */
body.ug .topbar-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
    min-width: max-content !important;
}

/* 顶部按钮压缩一点 */
body.ug .topbar-store,
body.ug .lang-switch button,
body.ug .topbar-user,
body.ug .topbar-notification {
    flex-shrink: 0 !important;
}

/* 清理危险旧规则的影响 */
body.ug .app-topbar[style],
body.ug .topbar[style],
body.ug .header-bar[style] {
    width: 100% !important;
}

/* 中文版不动。如果中文也使用 app-sidebar/app-main，则保持原来的 CSS。 */

/* ===== 全局输入框、下拉框、按钮字体统一继承 ===== */
input,
select,
textarea,
button {
    font-family: inherit !important;
}

.form-control,
.form-select,
.btn,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="tel"],
input[type="search"],
textarea,
select {
    font-family: inherit !important;
}

body.ug input,
body.ug select,
body.ug textarea,
body.ug button,
html[lang="ug"] input,
html[lang="ug"] select,
html[lang="ug"] textarea,
html[lang="ug"] button {
    font-family: 'UyghurWebFont', Arial, 'Microsoft YaHei', 'Segoe UI', sans-serif !important;
}

.ltr-num,
input[type="number"],
input[type="date"],
.scan-code,
.product-code,
.amount,
.weight {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* ===== 维语版顶部标题：标题和副标题保持同一组 ===== */
body.ug .app-topbar {
    direction: ltr !important;
}

body.ug .topbar-title-block {
    direction: ltr !important;
    text-align: left !important;
    flex: 1 1 auto !important;
    max-width: calc(100% - 500px) !important;
    gap: 8px !important;
}

body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
    line-height: 1.45 !important;
    padding-bottom: 4px !important;
    overflow: visible !important;
}

body.ug .topbar-main-title {
    font-size: 21px !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

body.ug .topbar-sub-title {
    font-size: 11.5px !important;
    white-space: nowrap !important;
    max-width: 330px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 0 1 auto !important;
}

body.ug .title-divider {
    flex: 0 0 auto !important;
}

/* 右侧操作区不许挤进标题区 */
body.ug .topbar-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

/* ===== 修复顶部维语文字被裁切 ===== */
.app-topbar {
    height: 60px !important;
    min-height: 60px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    overflow: visible !important;
}

.topbar-title-block {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.topbar-main-title,
.topbar-sub-title,
.title-divider {
    display: inline-flex !important;
    align-items: center !important;
    overflow: visible !important;
    padding-top: 1px !important;
    padding-bottom: 3px !important;
}

.topbar-main-title {
    font-size: 21px !important;
    line-height: 1.35 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

.topbar-sub-title {
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    flex: 0 1 auto !important;
    max-width: 360px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.title-divider {
    line-height: 1.35 !important;
    color: #b8872f !important;
    font-weight: 900 !important;
    flex: 0 0 auto !important;
}

/* ===== 统一侧边栏宽度变量 ===== */
:root {
    --app-sidebar-width: 250px;
}

/* 中文版左侧栏 */
body:not(.ug) .app-sidebar,
body:not(.ug) .sidebar {
    width: var(--app-sidebar-width) !important;
    left: 0 !important;
    right: auto !important;
}

body:not(.ug) .app-main,
body:not(.ug) .main-content,
body:not(.ug) .content-wrapper {
    margin-left: var(--app-sidebar-width) !important;
    margin-right: 0 !important;
    width: calc(100% - var(--app-sidebar-width)) !important;
    max-width: none !important;
}

body:not(.ug) .app-topbar,
body:not(.ug) .topbar,
body:not(.ug) .header-bar {
    left: var(--app-sidebar-width) !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* 维语版右侧栏 */
body.ug .app-sidebar,
body.ug .sidebar {
    width: var(--app-sidebar-width) !important;
    right: 0 !important;
    left: auto !important;
}

body.ug .app-main,
body.ug .main-content,
body.ug .content-wrapper {
    margin-left: 0 !important;
    margin-right: var(--app-sidebar-width) !important;
    width: calc(100% - var(--app-sidebar-width)) !important;
    max-width: none !important;
}

body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    left: 0 !important;
    right: var(--app-sidebar-width) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

/* ===== 顶部栏左右分区，防止标题和按钮重叠 ===== */
.app-topbar,
.topbar,
.header-bar {
    height: 56px !important;
    min-height: 56px !important;
    padding: 6px 18px !important;
    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    overflow: visible !important;
}

.topbar-title-block {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 520px) !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow: hidden !important;
}

.topbar-main-title {
    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.topbar-title-divider {
    color: #b8872f !important;
    font-weight: 900 !important;
    flex: 0 0 auto !important;
    line-height: 1 !important;
}

.topbar-sub-title {
    font-size: 12px !important;
    line-height: 1 !important;
    color: #64748b !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.topbar-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.topbar-actions .btn,
.topbar-actions button,
.topbar-actions a {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 12.5px !important;
    border-radius: 9px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.topbar-actions i,
.topbar-actions svg {
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* ===== 按钮文字上下居中继续修复 ===== */
.app-topbar button,
.app-topbar a,
.topbar button,
.topbar a,
.header-bar button,
.header-bar a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.app-topbar i,
.topbar i,
.header-bar i {
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* ===== 紧急修复：维语版主布局 ===== */
body.ug .app-main,
body.ug .main-content,
body.ug .content-wrapper {
    margin-left: 0 !important;
    margin-right: 230px !important;
    width: calc(100% - 230px) !important;
    max-width: none !important;
}

body.ug .app-sidebar,
body.ug .sidebar {
    left: auto !important;
    right: 0 !important;
    width: 230px !important;
}

body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    left: 0 !important;
    right: 230px !important;
    width: calc(100% - 230px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    direction: ltr !important;
    height: 64px !important;
    min-height: 64px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

body.ug .topbar-title-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
    width: auto !important;
    max-width: 360px !important;
    min-width: 0 !important;
    direction: rtl !important;
    text-align: right !important;
    overflow: hidden !important;
}

body.ug .topbar-main-title {
    font-size: 20px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    max-width: 360px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
}

body.ug .topbar-sub-title {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    max-width: 360px !important;
    color: #64748b !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
}

body.ug .topbar-title-block,
body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
}

body.ug .brand-subtitle,
body.ug .sidebar-brand-subtitle {
    display: none !important;
}

/* 维语 .sidebar-brand / .sidebar-brand-title 旧覆盖已移除，
   新 Grid 布局（Logo 左/标题右）在 app-layout-extend.css 统一管理。 */

/* ===== 修复：顶部页面标题恢复一行显示 ===== */
.topbar-title-block,
body.ug .topbar-title-block {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    max-width: none !important;
    width: auto !important;
    min-width: 0 !important;
    direction: ltr !important;
    text-align: left !important;
    overflow: visible !important;
}

.topbar-main-title,
body.ug .topbar-main-title {
    font-size: 22px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    max-width: none !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.topbar-sub-title,
body.ug .topbar-sub-title {
    font-size: 12.5px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    max-width: none !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    color: #64748b !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.topbar-title-divider,
body.ug .topbar-title-divider {
    display: inline-flex !important;
    align-items: center !important;
    color: #b8872f !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
}

/* ===== 只让维语侧边栏品牌标题两行显示 ===== */
body.ug .ug-sidebar-brand-title {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    direction: rtl !important;
    text-align: right !important;
    max-width: 170px !important;
}

body.ug .ug-sidebar-brand-title span {
    display: block !important;
    white-space: nowrap !important;
}

body.ug .sidebar-brand-subtitle,
body.ug .brand-subtitle {
    display: none !important;
}

/* ===== 统一侧边栏宽度，修复顶部右侧空白 ===== */
:root {
    --sidebar-width-compact: 250px;
}

.app-sidebar,
.sidebar {
    width: var(--sidebar-width-compact) !important;
}

body.ug .app-sidebar,
body.ug .sidebar {
    right: 0 !important;
    left: auto !important;
    width: var(--sidebar-width-compact) !important;
}

body.ug .app-main,
body.ug .main-content,
body.ug .content-wrapper {
    margin-left: 0 !important;
    margin-right: var(--sidebar-width-compact) !important;
    width: calc(100% - var(--sidebar-width-compact)) !important;
    max-width: none !important;
}

body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    left: 0 !important;
    right: var(--sidebar-width-compact) !important;
    width: calc(100% - var(--sidebar-width-compact)) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    direction: ltr !important;
}

/* ===== 最终修复：维语版 topbar 不再二次扣除 sidebar 宽度 ===== */
:root {
    --app-sidebar-width: 250px;
}

/* 维语版：侧边栏固定在右侧 */
body.ug .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: var(--app-sidebar-width) !important;
    height: 100vh !important;
    z-index: 1000 !important;
}

/* 维语版：主内容只在这里给右侧栏让位置 */
body.ug .app-main {
    margin-left: 0 !important;
    margin-right: var(--app-sidebar-width) !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* 关键：topbar 在 app-main 内部，只占满 app-main，不再扣 sidebar */
body.ug .app-topbar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    z-index: 900 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    overflow: visible !important;
}

/* 防止旧规则继续影响 topbar */
body.ug .topbar,
body.ug .header-bar {
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* 顶部左侧标题区域：可以缩，但不能挤到右侧按钮 */
body.ug .topbar-title-block,
body.ug .page-title-area {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    direction: ltr !important;
}

/* 维语文字本身 RTL，但不要让整个 topbar RTL */
body.ug .topbar-main-title,
body.ug .topbar-sub-title {
    direction: rtl !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.ug .topbar-main-title {
    font-size: 20px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}

body.ug .topbar-sub-title {
    font-size: 11.5px !important;
    line-height: 1 !important;
    flex: 1 1 auto !important;
}

/* 分隔线 class 兼容 */
body.ug .title-divider,
body.ug .topbar-title-divider {
    flex: 0 0 auto !important;
    color: #b8872f !important;
    font-weight: 900 !important;
}

/* 顶部右侧操作区固定宽度，不允许被标题压住 */
body.ug .topbar-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    white-space: nowrap !important;
    min-width: max-content !important;
}

/* 顶部按钮压缩一点 */
body.ug .topbar-store,
body.ug .lang-switch button,
body.ug .topbar-user,
body.ug .topbar-notification {
    flex-shrink: 0 !important;
}

/* 清理危险旧规则的影响 */
body.ug .app-topbar[style],
body.ug .topbar[style],
body.ug .header-bar[style] {
    width: 100% !important;
}

/* 中文版不动。如果中文也使用 app-sidebar/app-main，则保持原来的 CSS。 */
