/*
 * ╔══════════════════════════════════════════════════════════════╗
 * ║           CGo UI Library — cgo_ui.css                       ║
 * ║           页面整体排版与布局 (Layout & Responsive System)    ║
 * ║                                                              ║
 * ║  版本：1.0.0 · 2026-06                                       ║
 * ║  作者：Central Go / NaL                                      ║
 * ║                                                              ║
 * ║  内容：                                                      ║
 * ║    1. 页面骨架 (Page Skeleton)                               ║
 * ║    2. 顶部导航栏 (Header)                                     ║
 * ║    3. 通用内容区 (Main Content Container)                     ║
 * ║    4. 底部栏 (Footer / Bottom Bar)                            ║
 * ║    5. 侧边栏布局 (Sidebar Layout)                             ║
 * ║    6. 管理台布局 (Admin Shell Layout)                         ║
 * ║    7. 图片查看器 (Image Viewer)                               ║
 * ║    8. PDF 阅读器 (PDF Reader)                                 ║
 * ║    9. 地图全屏布局 (Map Full-screen)                          ║
 * ║   10. 浮窗 (Floating Window)                                  ║
 * ║   11. 面板淡入动画 (Panel Animation)                          ║
 * ║   12. 响应式 — 720px 以下 (Mobile)                            ║
 * ║   13. 响应式 — 768px 以下 (Sidebar 折叠)                      ║
 * ║   14. 响应式 — 640px 以下 (超窄屏)                            ║
 * ╚══════════════════════════════════════════════════════════════╝
 *
 * ⚠  依赖：请先引入 cgo_clr.css → cgo_element.css → cgo_ui.css
 */

/* =====================================================
   §1  页面骨架 (Page Skeleton)
   ===================================================== */
body {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 地图页等需要滚动的页面覆写 */
body.scrollable {
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
}

/* =====================================================
   §2  顶部导航栏 (Header / Toolbar)
   ===================================================== */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background-color: var(--header-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    flex-shrink: 0;
    z-index: 100;
    position: sticky;
    top: 0;
    touch-action: none;
    color: var(--text-main);
    transition: background-color 0.3s, border-color 0.3s;
}

/* 磁性 Header（玻璃态，适用于 cgoauth 风格）*/
.cgoauth-header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}

/* Header 三区块 */
.header-left,
.header-right {
    display: flex;
    align-items: center;
    z-index: 2;
    min-width: 80px;
    gap: 8px;
}
.header-left .btn,
.header-right .btn { margin: 0 !important; }
.header-right { justify-content: flex-end; }

/* 居中标题区 */
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    touch-action: manipulation;
}
.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}
.header-logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
    border-radius: 6px;
}
.app-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Header 内分组 */
.header-actions,
.header-system {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 备案图标 */
.beian-icon {
    height: 14px;
    margin-right: 2px;
    vertical-align: middle;
}

/* =====================================================
   §3  通用内容区 (Main Content Container)
   ===================================================== */
.tool-container {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    overflow-y: auto;
}

/* Panel 面板动画（用于侧边内容切换）*/
.panel {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease forwards;
}
.panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 主内容区（cgoauth 风格，内嵌 sidebar）*/
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* =====================================================
   §4  底部栏 (Footer / Bottom Bar)
   ===================================================== */
.bottom-bar,
.tool-footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: none;
    transition: background-color 0.3s;
}

.footer-content,
.footer-items {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-content a,
.footer-items a { touch-action: manipulation; }
.footer-content a:hover,
.footer-items a:hover { text-decoration: underline; }

/* =====================================================
   §5  侧边栏布局 (Sidebar Layout — cgoauth)
   ===================================================== */
.cgoauth-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100dvh - var(--header-height));
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.user-brief {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}
.user-names { text-align: center; width: 100%; }
.username-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.email-display {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 10px;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-sans);
}
.nav-item:hover { background-color: var(--btn-info-bg); color: var(--text-main); }
.nav-item.active { background-color: var(--primary-color); color: var(--btn-text); }
.nav-item.active .nav-icon { fill: var(--btn-text); }
.nav-item.text-danger { color: var(--danger-color); }
.nav-item.text-danger:hover { background-color: rgba(217,48,37,0.1); color: var(--danger-color); }
.nav-item.active.text-danger { background-color: var(--danger-color); color: #fff !important; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

/* =====================================================
   §6  管理台布局 (Admin Shell Layout)
   ===================================================== */
.admin-shell {
    --admin-bg:           var(--bg-color, #eef3f8);
    --admin-surface:      var(--card-bg, #ffffff);
    --admin-surface-soft: var(--panel-bg, #f6f8fb);
    --admin-text:         var(--text-main, #102033);
    --admin-muted:        var(--text-light, #64748b);
    --admin-border:       var(--border-color, #d5deea);
    --admin-border-strong: color-mix(in oklab, var(--border-color) 80%, var(--text-main));
    --admin-primary:      var(--primary-color, #155e9f);
    --admin-primary-hover: var(--primary-hover, #0e4e87);
    --admin-primary-soft: color-mix(in oklab, var(--primary-color) 12%, transparent);
    --admin-focus:        color-mix(in oklab, var(--primary-color) 22%, transparent);
    --permission-section-accent: var(--primary-color, #155e9f);
    --permission-section-soft:   color-mix(in oklab, var(--primary-color) 8%, transparent);

    display: grid;
    grid-template-columns: 140px 1fr;
    min-height: calc(100vh - var(--header-height));
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-sidebar {
    border-right: 1px solid var(--admin-border);
    background: color-mix(in oklab, var(--admin-surface) 86%, transparent);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 8px 0 26px rgba(16,32,51,0.05);
}

.admin-main {
    padding: 20px;
    overflow: auto;
}

.admin-panel { display: none; }
.admin-panel.is-active { display: block; }

.admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.admin-panel-head h2 { margin: 0; font-size: 20px; color: var(--admin-text); }

/* 用户 / 用户组列表 + 详情双栏 */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    transition: all 400ms cubic-bezier(0.4,0,0.2,1);
}
.admin-grid.is-detail-view {
    grid-template-columns: 360px 1fr;
    gap: 20px;
}
.admin-grid.is-detail-view .admin-list,
.admin-grid.is-detail-view .admin-detail,
.audit-list {
    height: calc(100vh - 160px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.admin-grid:not(.is-detail-view) .admin-detail { display: none; }

.admin-list,
.admin-detail,
.audit-list {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(16,32,51,0.06);
    transition: all 300ms ease;
    padding: 8px;
}
.admin-detail {
    padding: 16px 16px 120px;
    overflow: auto;
    position: relative;
    z-index: 0;
}
.admin-detail.has-open-select { z-index: 20; }

/* 固定保存按钮 */
.admin-sticky-actions {
    position: fixed;
    right: 32px;
    bottom: 20px;
    z-index: 140;
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: color-mix(in oklab, var(--admin-surface) 88%, transparent);
    box-shadow: 0 18px 46px rgba(16,32,51,0.16);
    backdrop-filter: blur(12px);
}
.admin-sticky-actions .btn { min-width: 126px; min-height: 38px; font-size: 14px; }

/* =====================================================
   §7  图片查看器 (Image Viewer)
   ===================================================== */
.image-viewer-card {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.image-display-area {
    width: 100%;
    min-height: 400px;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* 网格点背景 */
    background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 20px 20px;
}
.image-display-area img {
    max-width: 100%;
    height: auto;
    max-height: 70dvh;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: opacity 0.3s ease;
}

.viewer-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 15px;
    background: var(--card-bg);
}

/* =====================================================
   §8  PDF 阅读器 (PDF Reader)
   ===================================================== */
.pdf-wrapper {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.pdf-controls {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}
#pdf-canvas-container {
    flex: 1;
    overflow: auto;
    background-color: #525659;
    border-radius: 4px;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
    max-height: 80dvh;
}
canvas { display: block; margin: 0 auto; }

/* 英文地图专用容器 */
.enmap-container {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 100px);
}

/* =====================================================
   §9  地图全屏布局 (Map Full-screen)
   ===================================================== */
body.map-page {
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.map-shell {
    position: relative;
    flex: 1;
    overflow: hidden;
    width: 100%;
}

/* 状态底栏（vitool canvas 底部）*/
.status-bar {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 0 16px;
    font-size: 12px;
    color: var(--text-light);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}
.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-item { white-space: nowrap; }
.status-divider { color: var(--border-color); }

/* 缩放控件 */
.zoom-controls { display: flex; align-items: center; gap: 4px; }
.zoom-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.zoom-btn:hover { background: var(--btn-info-hover); color: var(--text-main); }

/* 悬浮操作栏（canvas 区域）*/
.float-action-bar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 300;
}
.canvas-top-bar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}
.canvas-top-bar > * { pointer-events: auto; }

/* 右键菜单 */
.context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    padding: 6px;
    min-width: 160px;
    display: none;
}
.context-menu.visible { display: block; }

/* =====================================================
   §10  浮窗 (Floating Window)
   ===================================================== */
.floating-window {
    position: fixed;
    z-index: 800;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 200px;
    display: none;
}
.floating-window.is-visible { display: flex; flex-direction: column; }

.floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--tab-bg);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}
.floating-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.floating-controls { display: flex; gap: 4px; }
.floating-minimize-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: background var(--transition-base);
}
.floating-minimize-btn:hover { background: var(--btn-info-hover); }
.floating-minimize-btn svg { width: 14px; height: 14px; stroke: currentColor; }

.floating-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
}

/* =====================================================
   §11  面板 / 卡片进入动画 (Animations)
   ===================================================== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.anim-slide-up  { animation: slideUp   0.3s ease forwards; }
.anim-slide-down{ animation: slideDown 0.3s ease forwards; }
.anim-scale-in  { animation: scaleIn   0.25s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.anim-fade-up   { animation: fadeInUp  0.4s ease forwards; }

/* iframe 内嵌隐藏 header */
.is-iframe-vitool-hidden .tool-header,
.is-iframe-vitool-hidden .bottom-bar,
.is-iframe-vitool-hidden .status-bar {
    display: none !important;
}

/* 联系我们对话框自适应高度 */
#contact-chat-wrapper {
    height: calc(100dvh - var(--header-height) - 180px);
    min-height: 400px;
}

/* =====================================================
   §12  响应式 — 720px 以下 (Mobile General)
   ===================================================== */
@media (max-width: 720px) {
    /* Header */
    .tool-header { padding: 8px 10px; }
    .header-logo { height: 24px; }
    .app-title   { font-size: 0.95rem; }

    /* 按钮在小屏仅显示图标 */
    .btn span          { display: none; }
    .btn               { padding: 6px; }
    .header-right > span,
    .header-right > .btn span,
    .header-right > .dropdown > .btn span { display: none; }

    /* 保留文字的特殊情况 */
    .viewer-actions .btn span,
    .pdf-controls .ctrl-btn span,
    .pdf-controls .btn span {
        display: inline;
    }
    .viewer-actions .btn,
    .pdf-controls .ctrl-btn {
        padding: 0 15px;
        height: 36px;
        width: 100%;
    }

    /* 卡片扁平化 */
    .tool-card {
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 10px;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        padding: 20px 15px;
    }

    /* 选项卡 */
    .tab-item { padding: 10px 15px; font-size: 13px; }

    /* 查看器 */
    .viewer-actions { flex-direction: column; }
    .image-display-area { min-height: 250px; }

    /* PDF */
    .pdf-wrapper    { padding: 10px 0; border-radius: 0; box-shadow: none; }
    .pdf-controls   { flex-wrap: wrap; }
    .ctrl-btn       { flex: 1 1 40%; font-size: 12px; }

    /* 筛选器 */
    .filter-tags {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
        flex-wrap: nowrap;
    }
    .filter-tag       { flex-shrink: 0; }
    .filter-toolbar   { flex-direction: column; align-items: flex-start; }
    .filter-card      { padding: 15px 10px !important; }

    /* 表格容器 */
    .table-container,
    .table-responsive { border-radius: 0; box-shadow: none; border: none; }

    /* 信息卡 */
    .info-card { border-radius: 0; margin-top: 0; }

    /* 页面标题 */
    .page-title { font-size: 24px; }

    /* 底栏折行 */
    .bottom-bar,
    .tool-footer { height: auto !important; min-height: 60px; }
    .bottom-bar .footer-content,
    .tool-footer .footer-items {
        flex-direction: column !important;
        gap: 2px !important;
        line-height: 1.3 !important;
        padding: 5px 0 !important;
    }
    .bottom-bar, .tool-footer,
    .footer-content span, .footer-items span,
    .footer-content a,   .footer-items a { font-size: 10px !important; }
    .beian-icon { height: 10px !important; }

    /* 英文地图 */
    .enmap-container { padding: 0; height: calc(100dvh - 120px); }
    .enmap-container .pdf-wrapper { border-radius: 0; box-shadow: none; padding: 10px 0; }

    /* 联系对话框 */
    #contact-chat-wrapper {
        height: calc(100dvh - var(--header-height) - 220px);
    }

    /* 等级卡片 */
    .current-level-card {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 20px;
    }
    .level-card-svg      { height: auto; width: 100%; max-width: 320px; }
    .current-level-content { justify-content: center; width: 100%; }
    .level-badge-container { justify-content: center; width: 100%; }

    /* 帮助弹窗 */
    .help-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   §13  响应式 — 768px 以下 (Sidebar 折叠)
   ===================================================== */
@media (max-width: 768px) {
    /* cgoauth 侧边栏 → 顶部横向导航 */
    .cgoauth-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100dvh - var(--header-height));
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        align-items: center;
        padding: 0;
        z-index: 10;
        position: static;
        height: auto;
        background: var(--bg-card);
        box-shadow: none;
        flex-shrink: 0;
    }
    .user-brief, .sidebar-footer { display: none; }
    .nav-menu {
        display: flex;
        flex-direction: row;
        padding: 10px 12px;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        scrollbar-width: none;
    }
    .nav-menu::-webkit-scrollbar { display: none; }
    .nav-item {
        flex-direction: row;
        align-items: center;
        padding: 8px 14px;
        margin: 0;
        border-radius: 20px;
        font-size: 0.85rem;
        gap: 6px;
        width: auto;
        flex-shrink: 0;
        background-color: var(--btn-info-bg);
        color: var(--text-light);
    }
    .nav-item:hover   { background-color: var(--btn-info-bg); }
    .nav-item.active  { background-color: var(--primary-color); color: var(--btn-text); }
    .nav-icon         { margin: 0; width: 16px; height: 16px; }
    .nav-item span    { display: inline; }

    .main-content { padding: 15px; margin-bottom: 0; }

    /* 表单 */
    .form-control   { font-size: 16px; /* 防止 iOS 自动缩放 */ }
    .input-row      { flex-direction: column; }
    .avatar-section { flex-direction: column; align-items: center; gap: 20px; }
    .avatar-controls { width: 100%; }
    .avatar-grid    { grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; }
    .danger-row     { flex-direction: column; align-items: stretch; text-align: center; gap: 15px; }
    .tool-card      { padding: 20px 15px; }

    /* 管理台 */
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px 12px;
        gap: 6px;
        border-right: none;
        border-bottom: 1px solid var(--admin-border);
        box-shadow: none;
        scrollbar-width: none;
    }
    .admin-sidebar::-webkit-scrollbar { display: none; }
    .admin-tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 14px;
        border-radius: 20px;
        font-size: 0.85rem;
    }
    .admin-grid.is-detail-view {
        grid-template-columns: 1fr;
    }
    .admin-grid.is-detail-view .admin-list,
    .admin-grid.is-detail-view .admin-detail {
        height: auto;
        max-height: calc(50vh - 80px);
    }
    .admin-sticky-actions { right: 16px; bottom: 16px; }
}

/* =====================================================
   §14  响应式 — 640px 以下 (超窄屏 Extra Narrow)
   ===================================================== */
@media (max-width: 640px) {
    /* 偏好设置分行 */
    .pref-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }
    .pref-left-group {
        width: 100%;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 6px;
        gap: 8px;
    }
    .pref-middle-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-right: 0;
    }
    .pref-status-text {
        font-size: 0.85rem;
        background: var(--btn-info-bg);
        border: 1px solid var(--border-color);
        padding: 4px 10px;
        border-radius: 6px;
        display: inline-block;
        color: var(--text-main);
        max-width: 100%;
    }
    .pref-actions {
        align-self: flex-end;
        margin-top: 4px;
        width: auto;
        min-width: 0;
    }

    /* 工具切换下拉 */
    .tool-switcher-menu {
        min-width: 180px;
    }

    /* 对话框 */
    .text-dialog, .help-dialog, .modal-dialog {
        width: 96vw;
    }
}
