/* ============================================================
   视通科技(AVSYS)产品价格管理系统 - 全局样式 v2 (PC + 移动端响应式)
   ============================================================ */

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

:root {
    --primary: #4472C4;
    --primary-dark: #2F5496;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-secondary: #7f8c8d;
    --border: #dcdde1;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
    --mobile-bottom-nav-height: 60px;
    --navbar-height: 56px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

body.is-mobile {
    --navbar-height: 50px;
}

/* ============================================================
   导航栏 (PC)
   ============================================================ */
.navbar {
    background: var(--primary-dark);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: var(--navbar-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 8px;
}

.nav-brand {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.brand-icon { font-size: 20px; }
.brand-text { }

.brand-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

body.is-mobile .brand-logo {
    height: 30px;
}

body.is-mobile .brand-text {
    font-size: 13px;
}

.brand-short { display: none; }
body.is-mobile .brand-full { display: none; }
body.is-mobile .brand-short { display: inline; }

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}

.nav-icon { font-size: 16px; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logout-btn {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ============================================================
   汉堡按钮 (移动端)
   ============================================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    z-index: 102;
}

.hamburger span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 菜单遮罩 */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.menu-overlay.show { display: block; }
body.menu-open { overflow: hidden; }

/* 桌面端强制 menu-overlay 不显示、不拦截点击（防止插件或状态异常导致遮挡） */
.is-desktop .menu-overlay,
.is-desktop .menu-overlay.show {
    display: none !important;
    pointer-events: none !important;
}

/* ============================================================
   移动端底部导航
   ============================================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-bottom-nav-height);
    background: white;
    border-top: 1px solid var(--border);
    z-index: 90;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.mobile-bottom-nav .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    transition: color 0.2s;
    position: relative;
}

.mobile-bottom-nav .bottom-nav-item.active {
    color: var(--primary);
}

.bn-icon { font-size: 20px; margin-bottom: 1px; }
.bn-label { line-height: 1; }

.bottom-nav-primary .bn-icon {
    font-size: 24px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: 0 2px 8px rgba(68,114,196,0.4);
}

.bottom-nav-primary.active { color: var(--primary); }

.bottom-nav-logout .bn-icon { opacity: 0.6; }

/* ============================================================
   主内容区
   ============================================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

body.is-mobile .main-content {
    padding: 12px;
    padding-bottom: calc(var(--mobile-bottom-nav-height) + 16px);
}

/* ============================================================
   用户标签
   ============================================================ */
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin { background: #e74c3c; color: white; }
.role-editor { background: #f39c12; color: white; }
.role-viewer { background: #95a5a6; color: white; }

/* ============================================================
   Flash消息
   ============================================================ */
.flash-messages { margin-bottom: 16px; }

.flash-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
    animation: slideIn 0.3s ease;
}

.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

.flash-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: inherit; padding: 0 4px;
}

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

/* ============================================================
   页面容器
   ============================================================ */
.page-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

body.is-mobile .page-container {
    padding: 12px;
    border-radius: 10px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.page-header h1 {
    font-size: 20px;
    color: var(--primary-dark);
}

body.is-mobile .page-header h1 { font-size: 17px; }

.page-title {
    font-size: 22px;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

body.is-mobile .btn {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
}

body.is-mobile .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 32px;
}

/* ============================================================
   表单
   ============================================================ */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.form-section:last-child { border-bottom: none; }

.form-section h3 {
    font-size: 15px;
    color: var(--primary-dark);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

body.is-mobile .form-section h3 { font-size: 14px; }

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-col-2 { flex: 0 0 calc(16.66% - 10px); min-width: 100px; }
.form-col-3 { flex: 0 0 calc(25% - 9px); min-width: 140px; }
.form-col-4 { flex: 0 0 calc(33.33% - 8px); min-width: 180px; }
.form-col-6 { flex: 0 0 calc(50% - 6px); min-width: 220px; }
.form-col-8 { flex: 0 0 calc(66.66% - 4px); min-width: 280px; }
.form-col-12 { flex: 1; min-width: 280px; }

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

body.is-mobile .form-group label { font-size: 12px; }

.required { color: var(--danger); }

.form-input, .form-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--text);
    transition: border-color 0.2s;
    width: 100%;
}

body.is-mobile .form-input, body.is-mobile .form-select {
    font-size: 16px; /* 防止 iOS 缩放 */
    padding: 10px 12px;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68,114,196,0.15);
}

textarea.form-input { resize: vertical; min-height: 60px; }
.inline-form { display: inline; }
.plain-input {
    border: none; background: transparent; padding: 4px;
    font-size: 13px; color: var(--text); width: 100%; outline: none;
}

/* ============================================================
   数据表格
   ============================================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    top: 0;
    border-right: 1px solid rgba(255,255,255,0.25);
}
.data-table th:last-child { border-right: none; }

.data-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: break-word;
}
.data-table td:last-child { border-right: none; }

.data-table tr:hover { background: #f8f9ff; }
.data-table tr:last-child td { border-bottom: none; }

/* 行高拖拽手柄 */
.row-resize-handle {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 5px;
    cursor: row-resize;
    z-index: 2;
    background: transparent;
    transition: background 0.15s;
}
.row-resize-handle:hover {
    background: rgba(52, 152, 219, 0.25);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.price-cell {
    font-family: "Consolas", "Monaco", monospace;
    font-variant-numeric: tabular-nums;
}

.empty-row { text-align: center; color: var(--text-secondary); padding: 40px !important; }
.total-row td { background: #e8f5e9; font-weight: 600; }

.cell-image { text-align: center; }

.product-thumb {
    width: 48px; height: 48px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.no-image {
    font-size: 28px; display: inline-block;
    width: 48px; height: 48px; line-height: 48px;
    background: var(--bg); border-radius: 4px;
}

.cell-name {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cell-actions {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.cell-actions .btn-sm,
.cell-actions .inline-form {
    display: inline-block;
    vertical-align: middle;
}

/* 缩略显示 — 文本截断，完整内容通过原生 title 属性悬停展示 */
.cell-desc {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f0fe;
    color: var(--primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.pc-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}
.pc-parent {
    background: #5DCAA5;
    color: #04342C;
}
.pc-child {
    background: #85B7EB;
    color: #042C53;
}

.combined-parent-row {
    background: #E1F5EE !important;
}
.combined-child-row {
    background: #E1F5EE !important;
}
.combined-subtotal-row {
    background: #D3D1C7 !important;
    font-size: 12px;
}
.combined-subtotal-row td {
    border-top: 1px solid #888780;
}

.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.status-draft { background: #dfe6e9; color: #636e72; }
.status-downloaded { background: #a29bfe; color: white; }
.status-sent { background: #74b9ff; color: white; }
.status-confirmed { background: #00b894; color: white; }
.status-cancelled { background: #fab1a0; color: #d63031; }

.btn-info { background: #6c5ce7; color: white; }
.btn-info:hover { background: #5a4bd1; }

.version-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #6c5ce7;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    min-width: 36px;
    text-align: center;
}
.version-badge:hover { background: #5a4bd1; color: white; text-decoration: none; }

/* 同一报价单号的版本行分组 */
tr.version-sibling td { border-top: 1px dashed var(--border); }
tr.version-sibling .q-no { opacity: 0.4; }

/* 多条件筛选栏 */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.filter-form .form-input {
    width: 130px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}
.filter-form .form-select {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}

/* 版本时间线 */
.version-timeline {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid #dfe6e9;
    margin-left: 8px;
}
.version-item {
    position: relative;
    margin-bottom: 20px;
}
.version-dot {
    position: absolute;
    left: -35px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #b2bec3;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #b2bec3;
}
.version-dot.status-draft { box-shadow: 0 0 0 2px #636e72; background: #636e72; }
.version-dot.status-downloaded { box-shadow: 0 0 0 2px #a29bfe; background: #a29bfe; }
.version-dot.status-sent { box-shadow: 0 0 0 2px #74b9ff; background: #74b9ff; }
.version-dot.status-confirmed { box-shadow: 0 0 0 2px #00b894; background: #00b894; }
.version-dot.active { box-shadow: 0 0 0 3px #e74c3c; background: #e74c3c; transform: scale(1.3); }
.version-content {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 14px;
}
.version-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.version-number {
    font-weight: 700;
    font-size: 14px;
    color: #2d3436;
}
.version-status {
    font-size: 12px;
    color: #636e72;
    background: #dfe6e9;
    padding: 1px 8px;
    border-radius: 8px;
}
.version-status-tag {
    display: inline-block;
    font-size: 12px;
    color: #636e72;
    background: #dfe6e9;
    padding: 1px 8px;
    border-radius: 8px;
}
.version-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #999;
}
.version-snapshot {
    margin-top: 8px;
}
.version-snapshot summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--primary);
}
.snapshot-content {
    margin-top: 6px;
}
.snapshot-pre {
    background: #2d3436;
    color: #dfe6e9;
    padding: 12px;
    border-radius: 4px;
    font-size: 11px;
    overflow-x: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-all;
}

.q-no {
    font-family: "Consolas", "Monaco", monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ============================================================
   移动端表格 → 卡片视图
   ============================================================ */
body.is-mobile .data-table,
body.is-mobile .data-table thead,
body.is-mobile .data-table tbody,
body.is-mobile .data-table th,
body.is-mobile .data-table td,
body.is-mobile .data-table tr {
    display: block;
}

body.is-mobile .data-table thead {
    display: none;
}

body.is-mobile .data-table tr {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
}

body.is-mobile .data-table tr:hover {
    background: #f8f9ff;
}

body.is-mobile .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

body.is-mobile .data-table td:last-child {
    border-bottom: none;
}

body.is-mobile .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    min-width: 60px;
    flex-shrink: 0;
    margin-right: 8px;
}

/* ============================================================
   移动端产品卡片视图
   ============================================================ */
.product-cards {
    display: none;
}

body.is-mobile .product-cards {
    display: block;
}

body.is-mobile .table-container[data-force-table] .product-cards {
    display: none;
}

.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.product-card .pc-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.product-card .pc-thumb {
    width: 56px; height: 56px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--bg);
    flex-shrink: 0;
}

.product-card .pc-thumb-placeholder {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    background: var(--bg);
    border-radius: 6px;
    flex-shrink: 0;
}

.product-card .pc-info { flex: 1; min-width: 0; }
.product-card .pc-name { font-weight: 600; font-size: 14px; }
.product-card .pc-model { font-size: 12px; color: var(--text-secondary); }
.product-card .pc-cat {
    display: inline-block; margin-top: 2px;
    padding: 1px 6px; background: #e8f0fe;
    color: var(--primary); border-radius: 8px; font-size: 11px;
}

.product-card .pc-prices {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}

.pc-price-tag {
    font-size: 11px; padding: 2px 6px;
    background: #f0f0f0; border-radius: 4px;
    color: var(--text-secondary);
}

.pc-price-tag strong {
    color: var(--primary-dark);
}

.product-card .pc-actions {
    display: flex; gap: 6px; margin-top: 8px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
    display: flex; justify-content: center; gap: 4px;
    margin-top: 16px; padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; text-decoration: none; color: var(--text);
    transition: all 0.2s;
}

body.is-mobile .page-link {
    min-width: 38px; height: 38px; font-size: 14px;
}

.page-link:hover { background: var(--bg); }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: 600; }

/* ============================================================
   筛选栏
   ============================================================ */
.filter-bar { margin-bottom: 12px; }

.filter-form {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

.filter-form .form-input,
.filter-form .form-select { width: auto; }

body.is-mobile .filter-form .form-input,
body.is-mobile .filter-form .form-select {
    flex: 1; min-width: 0;
}

.result-info {
    color: var(--text-secondary); font-size: 13px; margin-bottom: 10px;
}

/* ============================================================
   分类多选标签筛选栏
   ============================================================ */
.filter-section {
    margin-bottom: 14px;
}

.cat-filter-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 10px;
}

.cat-tag-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 14px;
    border-radius: 18px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.cat-tag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f4ff;
}
.cat-tag-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(68,114,196,0.35);
}
.cat-tag-btn.active::after {
    content: '✓';
    font-size: 11px; font-weight: 700;
    margin-left: 2px;
}

body.is-mobile .cat-tag-btn {
    padding: 6px 12px; font-size: 12px; border-radius: 16px;
}

/* 搜索栏（产品页专用） */
.search-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.search-input-lg {
    flex: 1; min-width: 200px; max-width: 420px;
}
body.is-mobile .search-input-lg {
    max-width: none; min-width: 0;
}
body.is-mobile .search-bar {
    gap: 6px;
}

/* ============================================================
   弹窗
   ============================================================ */
.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    min-width: 400px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-lg { min-width: 600px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; }

.modal-close {
    background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--text-secondary);
}

.modal-body { padding: 18px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 18px; border-top: 1px solid var(--border);
}

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 999;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

body.is-mobile .modal-content {
    min-width: 0; max-width: 94vw;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0; top: auto; left: 50%;
    transform: translateX(-50%);
    max-height: 80vh;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); }
    to { transform: translate(-50%, 0); }
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
    display: flex; justify-content: center; align-items: center;
    min-height: 80vh; padding: 20px;
}

.login-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 40px; width: 380px; max-width: 100%;
}

.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 { font-size: 22px; color: var(--primary-dark); margin-bottom: 4px; }
.login-header p { color: var(--text-secondary); font-size: 14px; }

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
}

body.is-mobile .login-logo {
    height: 55px;
}

.login-form .form-group { margin-bottom: 16px; }

body.is-mobile .login-container { padding: 28px 20px; }
body.is-mobile .login-header h1 { font-size: 20px; }

/* ============================================================
   企业微信扫码登录
   ============================================================ */
.wecom-login-section {
    text-align: center;
    margin-bottom: 20px;
}

.wecom-oauth-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.wecom-scan-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.wecom-scan-hint-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 12px;
}

.wecom-qr-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 12px auto;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 2px solid var(--border);
}

.wecom-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
}

.wecom-qr-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.wecom-qr-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    min-height: 20px;
}

.wecom-qr-actions {
    text-align: center;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-tertiary);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    padding: 0 12px;
}

/* 密码登录切换链接 */
.login-password-toggle {
    text-align: center;
    margin-top: 16px;
}

.login-password-toggle a {
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.login-password-toggle a:hover {
    color: var(--primary);
}

/* ============================================================
   仪表盘
   ============================================================ */
.dashboard { padding: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

body.is-mobile .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s;
}

body.is-mobile .stat-card {
    padding: 14px 12px;
    gap: 10px;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-icon { font-size: 36px; }
body.is-mobile .stat-icon { font-size: 28px; }

.stat-number { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
body.is-mobile .stat-number { font-size: 22px; }

.stat-label { font-size: 13px; color: var(--text-secondary); }
body.is-mobile .stat-label { font-size: 12px; }

.quick-actions {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.quick-actions h2 { font-size: 17px; margin-bottom: 14px; color: var(--primary-dark); }
body.is-mobile .quick-actions { padding: 16px; }
body.is-mobile .quick-actions h2 { font-size: 15px; }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

body.is-mobile .action-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.action-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px; background: var(--bg); border-radius: 8px;
    text-decoration: none; color: var(--text); font-size: 13px;
    font-weight: 500; transition: all 0.2s; border: 1px solid transparent;
}

body.is-mobile .action-card { padding: 14px 10px; font-size: 12px; }

.action-card:hover {
    border-color: var(--primary); background: #e8f0fe; transform: translateY(-1px);
}

.action-icon { font-size: 26px; }
body.is-mobile .action-icon { font-size: 24px; }

/* ---- 冠军领讲台 ---- */
.podium-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px;
    margin-bottom: 24px;
}
.podium-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 6px;
    margin-bottom: 11px;
}
.podium-header h2 {
    font-size: 14px; color: var(--primary-dark); margin: 0;
}

.period-tabs { display: flex; gap: 3px; }
.period-tab {
    display: inline-block; padding: 3px 10px;
    border-radius: 12px; font-size: 12px;
    text-decoration: none; color: var(--text-secondary);
    background: var(--bg); transition: all 0.2s;
    border: 1px solid transparent;
}
.period-tab:hover { color: var(--primary); border-color: var(--primary); }
.period-tab.active {
    background: var(--primary); color: #fff;
    font-weight: 600;
}

.podium-stage {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: end;
    min-height: 132px;
}
body.is-mobile .podium-stage {
    gap: 5px; min-height: 108px;
}

.podium-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 6px 0;
    background: linear-gradient(180deg, rgba(245,247,250,1) 0%, rgba(255,255,255,0) 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
}
.podium-item.centered { grid-column: 1 / -1; max-width: 108px; margin: 0 auto; }
.podium-crown { font-size: 16px; margin-bottom: 1px; animation: crown-bounce 1.5s ease infinite; }
@keyframes crown-bounce {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
.podium-avatar { font-size: 28px; line-height: 1; }
body.is-mobile .podium-avatar { font-size: 22px; }
.podium-name {
    font-size: 12px; font-weight: 600; color: var(--text);
    margin-top: 3px; text-align: center;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium-count {
    font-size: 13px; font-weight: 700; margin: 1px 0 4px;
}
body.is-mobile .podium-count { font-size: 11px; }
.podium-item.gold .podium-count { color: #c9890e; }
.podium-item.silver .podium-count { color: #7d8a9a; }
.podium-item.bronze .podium-count { color: #b87333; }

.podium-stand {
    width: 100%; text-align: center;
    padding: 6px 5px; border-radius: 4px 4px 0 0;
    font-size: 11px; font-weight: 700; color: #fff;
}
body.is-mobile .podium-stand { font-size: 10px; padding: 5px 4px; }
.gold-stand   { background: linear-gradient(180deg, #f5c842, #c9890e); height: 48px; }
.silver-stand { background: linear-gradient(180deg, #c0c8d4, #7d8a9a); height: 36px; }
.bronze-stand { background: linear-gradient(180deg, #d4a76a, #b87333); height: 26px; }
body.is-mobile .gold-stand   { height: 36px; }
body.is-mobile .silver-stand { height: 26px; }
body.is-mobile .bronze-stand { height: 20px; }

.podium-empty { grid-column: 1 / -1; text-align: center; padding: 24px; color: #999; }
.podium-empty-icon { font-size: 28px; }

/* ---- 排名表区域 ---- */
.ranking-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 24px;
}
.ranking-section h2 {
    font-size: 17px; color: var(--primary-dark); margin: 0 0 14px;
}
.rank-cell { font-weight: 600; font-size: 14px; }
.rank-cell.rank-top { color: var(--primary-dark); font-size: 16px; }
.rank-cell.rank-normal { color: var(--text-secondary); }
.rank-count { font-weight: 700; color: var(--primary-dark); font-size: 16px; }

body.is-mobile .ranking-section { padding: 16px; }
body.is-mobile .podium-section { padding: 16px; }

/* ============================================================
   产品选择器 (报价页)
   ============================================================ */
.product-selector {
    display: flex; gap: 16px;
    min-height: 350px;
}

body.is-mobile .product-selector {
    flex-direction: column;
    min-height: auto;
}

.selector-left {
    flex: 1; display: flex; flex-direction: column;
    min-width: 260px;
}

.selector-filter {
    display: flex; gap: 8px; margin-bottom: 8px;
}

.selector-filter .form-select { width: 130px; }

body.is-mobile .selector-filter .form-select { width: auto; flex: 1; }

.product-list {
    flex: 1; overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px; padding: 4px;
    background: #fafafa;
    max-height: 360px;
}

body.is-mobile .product-list {
    max-height: 200px;
}

.product-item {
    padding: 8px 12px; cursor: pointer; border-radius: 4px;
    margin-bottom: 2px; transition: background 0.15s;
    border: 1px solid transparent;
}

body.is-mobile .product-item {
    padding: 10px 12px;
    margin-bottom: 3px;
}

.product-item:hover { background: #e8f0fe; border-color: var(--primary); }
.product-item:active { background: #d0e0ff; }

.pi-name { font-weight: 600; font-size: 13px; }
.pi-model { font-size: 12px; color: var(--text-secondary); }
.pi-cat { font-size: 11px; color: var(--primary); }

.selector-right {
    flex: 1; border: 1px solid var(--border);
    border-radius: 6px; padding: 12px;
    overflow-y: auto; min-width: 240px;
    background: #fafafa;
}

body.is-mobile .selector-right {
    max-height: 250px; min-width: 0;
}

.detail-placeholder {
    color: var(--text-secondary); text-align: center; padding-top: 50px;
}

.detail-card h4 { font-size: 15px; margin-bottom: 8px; color: var(--primary-dark); }
.detail-card p { font-size: 13px; margin-bottom: 4px; color: var(--text-secondary); }

.mini-price-table {
    width: 100%; font-size: 12px; margin-top: 10px; border-collapse: collapse;
}

.mini-price-table th {
    background: #e8f0fe; padding: 4px 8px; text-align: left; font-size: 11px;
}

.mini-price-table td {
    padding: 5px 8px; border-bottom: 1px solid var(--border);
}

body.is-mobile .mini-price-table td {
    padding: 6px 8px;
}

/* ============================================================
   报价表头 (详情页)
   ============================================================ */
.quote-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; padding: 18px 22px;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 16px;
}

body.is-mobile .quote-header {
    padding: 14px 16px;
}

.quote-id {
    font-size: 18px; font-weight: 700; margin-bottom: 6px;
    display: flex; align-items: center; gap: 10px;
}

body.is-mobile .quote-id { font-size: 16px; }

.quote-label { font-size: 13px; opacity: 0.8; font-weight: 400; }
.quote-meta { display: flex; gap: 16px; font-size: 12px; opacity: 0.9; flex-wrap: wrap; }
body.is-mobile .quote-meta { gap: 10px; }

/* ============================================================
   信息卡片 (报价详情页)
   ============================================================ */
.info-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px;
}

body.is-mobile .info-cards { grid-template-columns: 1fr; }

.info-card {
    background: #f8f9ff; border: 1px solid var(--border);
    border-radius: 8px; padding: 14px;
}

.info-card h3 { font-size: 13px; margin-bottom: 8px; color: var(--primary-dark); }

.info-table { width: 100%; }
.info-table td { padding: 2px 0; font-size: 12px; }
.info-table .label { color: var(--text-secondary); width: 65px; font-weight: 500; }

body.is-mobile .info-table td { font-size: 13px; padding: 3px 0; }

/* ============================================================
   表单操作栏
   ============================================================ */
.form-actions {
    display: flex; gap: 10px; padding-top: 16px;
    border-top: 1px solid var(--border); margin-top: 4px;
}

body.is-mobile .form-actions {
    flex-direction: column;
    position: sticky;
    bottom: calc(var(--mobile-bottom-nav-height) + 10px);
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

body.is-mobile .form-actions .btn { flex: 1; }

/* ============================================================
   当前图片预览
   ============================================================ */
.current-image { margin-top: 6px; }
.current-image img {
    max-width: 120px; max-height: 80px;
    border-radius: 4px; border: 1px solid var(--border);
}

/* ============================================================
   上传按钮
   ============================================================ */
.upload-btn { cursor: pointer; }

/* ============================================================
   报价明细空状态
   ============================================================ */
.no-items-hint {
    text-align: center; padding: 30px;
    color: var(--text-secondary); font-size: 14px;
    border: 2px dashed var(--border);
    border-radius: 8px; margin-top: 8px;
}

/* ============================================================
   PC/移动端显隐控制
   ============================================================ */
@media screen and (min-width: 769px) {
    .hamburger { display: none; }
    .mobile-bottom-nav { display: none !important; }
    .desktop-only-nav { display: flex !important; }
}

@media screen and (max-width: 768px) {
    /* 顶部导航简化 */
    .brand-text { font-size: 14px; }
    .navbar { padding: 0 12px; }

    /* 汉堡按钮 */
    .hamburger { display: flex; }

    /* PC导航链接 → 侧滑菜单 */
    .nav-links {
        position: fixed;
        top: 0; right: -280px;
        width: 280px; height: 100vh;
        background: white;
        flex-direction: column;
        padding: 70px 16px 20px;
        z-index: 101;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        gap: 4px;
    }

    .nav-links.show { right: 0; }

    .nav-links .nav-link {
        color: var(--text);
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 15px;
    }

    .nav-links .nav-link:hover { background: var(--bg); }
    .nav-links .nav-link.active {
        background: #e8f0fe;
        color: var(--primary);
        font-weight: 600;
    }

    /* 移动端侧滑菜单中的退出 */
    .nav-links .nav-link.logout-mobile {
        margin-top: auto;
        color: var(--danger);
        border: 1px solid var(--danger);
    }

    /* 底部导航 */
    .mobile-bottom-nav {
        display: flex;
        flex-direction: row;
    }

    /* 隐藏PC端元素 */
    .desktop-only { display: none !important; }
    .desktop-only-nav { display: none !important; }

    /* 表格改为卡片 */
    .data-table, .data-table thead,
    .data-table tbody, .data-table th,
    .data-table td, .data-table tr {
        display: block;
    }

    .data-table thead { display: none; }

    body.is-mobile .data-table tr {
        background: var(--card-bg);
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid var(--border);
    }

    body.is-mobile .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
    }

    body.is-mobile .data-table td:last-child { border-bottom: none; }

    body.is-mobile .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        min-width: 60px;
        flex-shrink: 0;
    }

    /* 报价明细表保持表格形态 */
    #quotation-app .data-table,
    #quotation-app .data-table thead,
    #quotation-app .data-table tbody,
    #quotation-app .data-table th,
    #quotation-app .data-table td,
    #quotation-app .data-table tr {
        display: revert;
    }

    #quotation-app .data-table thead { display: revert; }
    #quotation-app .data-table td::before { content: none; }

    /* 表单列全宽 */
    .form-col-2, .form-col-3, .form-col-4,
    .form-col-6, .form-col-8, .form-col-12 {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* 报价明细表移动端水平滚动 */
    #quotation-app .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #quotation-app .data-table {
        min-width: 700px;
        font-size: 11px;
    }

    #quotation-app .data-table th,
    #quotation-app .data-table td {
        padding: 6px 4px;
    }
}

/* ============================================================
   打印样式
   ============================================================ */
@media print {
    .navbar, .header-actions, .flash-messages,
    .filter-bar, .pagination, .btn,
    .mobile-bottom-nav, .hamburger, .menu-overlay {
        display: none !important;
    }
    body { background: white; }
    .main-content { max-width: none; padding: 0; }
    .page-container { box-shadow: none; padding: 0; }
    body.is-mobile .main-content { padding: 0; }
}

/* ============================================================
   设置表单
   ============================================================ */
.settings-form .form-section { margin-bottom: 20px; }

/* ============================================================
   报价选品页
   ============================================================ */

/* 分类标签 */
.category-tabs {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 16px; padding: 4px 0;
}
.cat-tab {
    display: inline-block; padding: 6px 14px;
    background: #eef2f7; border-radius: 20px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s;
    user-select: none; white-space: nowrap;
}
.cat-tab:hover { background: #dde4f0; color: var(--text); }
.cat-tab.active {
    background: var(--primary); color: #fff;
    font-weight: 500;
}
body.is-mobile .cat-tab { font-size: 12px; padding: 5px 10px; }

.product-search-input {
    margin-left: auto; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; width: 200px; outline: none;
    transition: border 0.2s;
}
.product-search-input:focus { border-color: var(--primary); }
body.is-mobile .product-search-input { width: 120px; font-size: 12px; }

/* 选品表格 - 选中行高亮 */
.product-row { transition: background 0.2s; }
.product-row.selected { background: #f0f6ff !important; }
.product-row.selected td { border-bottom-color: #c8daf5; }

/* 大号选择框 */
.product-checkbox {
    width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary);
}

/* 底部固定栏 */
.quote-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 14px 24px; display: flex; align-items: center;
    justify-content: space-between;
    z-index: 50;
}
.bottom-bar-left {
    font-size: 15px; color: var(--text);
}
.bottom-bar-divider { margin: 0 14px; color: var(--border); }
body.is-mobile .quote-bottom-bar {
    padding: 10px 14px;
    bottom: var(--mobile-bottom-nav-height);
}
body.is-mobile .bottom-bar-left { font-size: 13px; }
body.is-mobile #btn-generate-quote { font-size: 14px; padding: 8px 16px; }

/* ============================================================
   新建报价单：左右分栏布局 (v33)
   ============================================================ */
.quote-split-layout {
    display: flex; gap: 8px;
    height: calc(100vh - 120px);
    padding: 0 8px;
    overflow: hidden;
}
.quote-left-panel {
    width: 30%; min-width: 240px;
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid #e8ecf5; border-radius: 8px;
    overflow: hidden;
}
.quote-right-panel {
    flex: 1;
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid #e8ecf5; border-radius: 8px;
    overflow: hidden;
}

/* 左侧工具栏 */
.quote-left-toolbar {
    display: flex; gap: 6px; padding: 6px 8px;
    border-bottom: 1px solid #eef0f5; align-items: center;
}
.quote-left-toolbar .product-search-input {
    margin-left: 0; width: auto; border-radius: 6px; padding: 4px 8px; font-size: 12px;
}

/* 分类多选下拉 */
.cat-multi-dropdown { position: relative; }
.cat-multi-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: #f5f7fa; border: 1px solid #ddd;
    border-radius: 6px; cursor: pointer; font-size: 12px; white-space: nowrap;
    color: #333;
}
.cat-multi-btn:hover { border-color: #4a6cf7; }
.cat-multi-btn .caret { font-size: 10px; color: #999; }
.cat-dropdown-menu {
    position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 300px; overflow-y: auto; z-index: 100;
    min-width: 160px; padding: 4px 0;
}
.cat-dropdown-item {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 14px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.cat-dropdown-item:hover { background: #f5f7fa; }
.cat-dropdown-item input { margin: 0; cursor: pointer; }

/* 左侧表格 */
.quote-left-table-wrap {
    flex: 1; overflow: auto;
}
.quote-left-table-wrap table { font-size: 12px; }
.quote-left-table-wrap th { font-size: 11px; padding: 4px 6px; background: var(--primary); color: white; }
.quote-left-table-wrap td { padding: 3px 6px; line-height: 26px; }
.quote-left-table-wrap .product-row { cursor: pointer; }
.quote-left-table-wrap .product-row:hover td { background: #f0f6ff; }

/* 左侧底部 */
.quote-left-footer {
    padding: 4px 8px; border-top: 1px solid #eef0f5;
    display: flex; justify-content: space-between; align-items: center;
}

/* 右侧标题行 */
.quote-right-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 12px; background: #f0f4ff; border-bottom: 1px solid #e0e8f5;
}
.quote-option-bar-inline { display: flex; gap: 10px; }
.quote-option-bar-inline .opt-chk {
    display: flex; align-items: center; gap: 3px;
    font-size: 11px; cursor: pointer; white-space: nowrap; color: #555;
}
.quote-option-bar-inline .opt-chk input { margin: 0; cursor: pointer; }

/* 右侧表格 */
.quote-right-table-wrap {
    flex: 1; overflow: auto;
}
.quote-right-table-wrap table { font-size: 12px; }
.quote-right-table-wrap th {
    font-size: 11px; padding: 4px 4px; background: var(--primary); color: white;
    white-space: nowrap;
}
.quote-right-table-wrap td {
    padding: 3px 4px; line-height: 26px;
}
.quote-right-table-wrap .no-spinner {
    -webkit-appearance: textfield; -moz-appearance: textfield;
    appearance: textfield; border: 1px solid #ddd; border-radius: 3px;
}
.quote-right-table-wrap .no-spinner::-webkit-outer-spin-button,
.quote-right-table-wrap .no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

/* 组合行样式 */
.combined-parent-row td { background: #e8f5e9 !important; }
.combined-child-row td { background: #f1f8f3 !important; }
.combined-subtotal-row td { background: #fff8e1 !important; }

/* 右侧底部栏 */
.quote-bottom-bar-inline {
    padding: 6px 12px; border-top: 1px solid #eef0f5;
    display: flex; gap: 10px; align-items: center; font-size: 12px;
}

/* 移动端：左右分栏改为上下 */
body.is-mobile .quote-split-layout {
    flex-direction: column; height: auto; overflow: visible;
}
body.is-mobile .quote-left-panel { width: 100%; min-width: 0; max-height: 300px; }
body.is-mobile .quote-right-panel { min-height: 400px; }

/* ============================================================
   报价弹窗 (Modal)
   ============================================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 200; overflow-y: auto; padding: 20px 12px;
}
.modal-dialog {
    background: var(--card-bg); border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    width: 100%; max-width: 960px;
    animation: modalIn 0.25s ease-out;
}
.modal-xl { max-width: 1140px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; color: var(--primary-dark); }
.modal-close {
    background: none; border: none; font-size: 26px;
    color: var(--text-secondary); cursor: pointer;
    width: 32px; height: 32px; display: flex;
    align-items: center; justify-content: center;
    border-radius: 4px; transition: all 0.2s;
}
.modal-close:hover { background: #fee; color: var(--danger); }

.modal-body {
    padding: 20px 24px; max-height: 78vh; overflow-y: auto;
}
body.is-mobile .modal-body { padding: 14px; max-height: 60vh; }

.modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border);
}
body.is-mobile .modal-footer { padding: 12px 14px; gap: 8px; }

body.is-mobile .modal-overlay { padding: 60px 8px 20px; align-items: flex-start; }
body.is-mobile .modal-dialog { border-radius: 10px; }

/* 报价弹窗内表单 — flex 列布局，产品清单区域自动撑满 */
#quote-form {
    display: flex; flex-direction: column;
    min-height: 100%;
}
#quote-form .form-section {
    background: var(--bg); border-radius: var(--radius);
    padding: 16px; margin-bottom: 14px;
    flex-shrink: 0; /* 默认不收缩 */
}
#quote-form .form-section h3 { font-size: 14px; margin-bottom: 10px; color: var(--primary-dark); }
body.is-mobile #quote-form .form-section { padding: 12px; }

/* 报价方/受价方/项目信息 — 行高压缩 50% */
#quote-form .compact-section {
    padding: 8px !important; margin-bottom: 7px !important;
}
#quote-form .compact-section h3 {
    font-size: 13px !important; margin-bottom: 6px !important; padding-bottom: 4px !important;
}
#quote-form .compact-section .form-row {
    gap: 8px; margin-bottom: 6px;
}
#quote-form .compact-section .form-group label {
    font-size: 12px;
}
#quote-form .compact-section .form-input,
#quote-form .compact-section .form-select {
    padding: 5px 8px; font-size: 13px;
}

/* 报价条款 — 行高压缩 60% */
#quote-form .compact-section-60 {
    padding: 7px !important; margin-bottom: 6px !important;
}
#quote-form .compact-section-60 h3 {
    font-size: 13px !important; margin-bottom: 5px !important; padding-bottom: 3px !important;
}
#quote-form .compact-section-60 .form-row {
    gap: 6px; margin-bottom: 4px;
}
#quote-form .compact-section-60 .form-group label {
    font-size: 12px;
}
#quote-form .compact-section-60 .form-input,
#quote-form .compact-section-60 .form-select {
    padding: 4px 8px; font-size: 13px;
}
#quote-form .compact-section-60 textarea.form-input {
    min-height: 36px; /* 约1行高度 */ height: 36px;
}

/* 报价产品清单 — 撑满所有剩余空间，内部滚动 */
#quote-form .product-list-section {
    flex: 1 1 auto; min-height: 250px;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 10px !important; margin-bottom: 10px !important;
}
#quote-form .product-list-section h3 {
    flex-shrink: 0;
}
#quote-form .product-list-section .table-container {
    flex: 1 1 auto; overflow-y: auto; min-height: 0;
}

/* 弹窗产品清单表格 — 紧凑行高 */
#modal-product-table th,
#modal-product-table td {
    padding: 4px 5px;
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: break-word;
}
/* cell-desc 列在弹窗内不需要 max-width 限制（table-layout:fixed 已控制列宽） */
#modal-product-table .cell-desc {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   字段配置网格
   ============================================================ */
.field-check-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 12px; background: var(--bg); border-radius: var(--radius);
}
.field-check-item {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px; background: white; border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; font-size: 13px;
    transition: all 0.15s; user-select: none;
}
.field-check-item:hover { border-color: var(--primary); background: #f0f6ff; }
.field-check-item input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);
}
body.is-mobile .field-check-item {
    font-size: 14px; padding: 8px 14px;
}

.form-hint {
    font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.text-secondary { color: var(--text-secondary); font-size: 13px; }

/* ============================================================
   列显示切换面板（产品浏览页）
   ============================================================ */
.field-toggle-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
}

.field-toggle-btn {
    flex-shrink: 0;
}

.field-toggle-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex: 1;
    animation: fadeIn 0.2s ease;
}

.field-toggle-panel .field-check-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}

.field-toggle-panel .field-check-item:hover {
    border-color: var(--primary);
    background: #f0f6ff;
}

.field-toggle-panel .field-check-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

.field-toggle-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

body.is-mobile .field-toggle-panel .field-check-item {
    font-size: 13px;
    padding: 6px 12px;
}

/* ============================================================
   列宽拖拽调整
   ============================================================ */
.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
    transition: background 0.15s;
}

.resize-handle:hover,
.resize-handle.active {
    background: rgba(255, 255, 255, 0.4);
}

.data-table th {
    position: relative;  /* for resize handle positioning */
}

body.resizing-col {
    cursor: col-resize;
    user-select: none;
}

body.resizing-col * {
    cursor: col-resize;
}

/* 固定表格布局（列宽调整时使用） */
.data-table.col-resize-ready {
    table-layout: fixed;
}

/* ============================================================
   弹窗（Modal）
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: modalIn 0.2s ease-out;
}

.modal-box.modal-danger {
    border-top: 4px solid var(--danger);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text);
}

.modal-file {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    word-break: break-all;
}

.modal-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.modal-actions .btn-lg {
    flex: 1;
    min-width: 140px;
    padding: 14px 18px;
    font-size: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-actions .btn-lg small {
    font-size: 12px;
    opacity: 0.85;
    font-weight: normal;
}

.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

/* Danger outline button */
.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

/* ============================================================
   图片放大 lightbox
   ============================================================ */
.img-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.img-lightbox-overlay.active {
    display: flex;
}

.img-lightbox-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    cursor: default;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.img-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.img-lightbox-close:hover {
    opacity: 1;
}

.img-lightbox-loading {
    display: none;
    color: #999;
    font-size: 16px;
    text-align: center;
}

.product-thumb {
    cursor: pointer;
    transition: transform 0.15s;
}

.product-thumb:hover {
    transform: scale(1.08);
}

/* ============================================================
   角色权限 badges
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: #d4edda;
    color: #155724;
}

.badge-blue {
    background: #cce5ff;
    color: #004085;
}

.badge-gray {
    background: #e2e3e5;
    color: #383d41;
}

/* ============================================================
   角色编辑页 权限选择
   ============================================================ */
.perm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.perm-item:hover {
    border-color: var(--primary);
    background: #e8f4fd;
}

.perm-item.perm-all {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: bold;
}

.perm-all input {
    accent-color: white;
}

.perm-hint {
    margin-top: 12px;
    color: #888;
    font-size: 13px;
}

.card-hint {
    font-size: 13px;
    color: #999;
    font-weight: normal;
    margin-left: 10px;
}

.page-hint {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
    margin-top: -8px;
}

/* ============================================================
   系统维护面板（备份/恢复/初始化）
   ============================================================ */

.maintain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .maintain-grid {
        grid-template-columns: 1fr;
    }
}

.maintain-card {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.maintain-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.maintain-card-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.maintain-card h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.maintain-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    min-height: 48px;
}

.maintain-card-warn {
    border-color: #f0ad4e;
    background: #fffdf5;
}

.maintain-card-danger {
    border-color: #d9534f;
    background: #fff5f5;
}

.maintain-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
}

/* 恢复/初始化确认弹窗内的警告框 */
.modal-warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.7;
    color: #856404;
}

.modal-warning-box p {
    margin: 4px 0;
}

.modal-warning-box ul {
    margin: 4px 0;
    padding-left: 20px;
}

.modal-warning-box ul li {
    margin: 3px 0;
}

/* ============================================================
   TOTP 动态口令相关样式
   ============================================================ */

/* 6位动态码输入框 */
.totp-code-input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* 登录页 TOTP 提示 */
.totp-icon-hint {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 12px;
}
.totp-icon-hint p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* 登录页底部链接 */
.login-footer-links {
    margin-top: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-footer-links a {
    color: #2F5496;
    font-size: 13px;
    text-decoration: none;
}
.login-footer-links a:hover {
    text-decoration: underline;
}

/* 步骤指示器 */
.totp-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0 30px;
    gap: 0;
}
.totp-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999;
}
.totp-step.active {
    color: #2F5496;
    font-weight: 600;
}
.totp-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.totp-step.active span {
    background: #2F5496;
}
.totp-step-line {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 8px;
}

/* 绑定说明区 */
.totp-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.totp-instructions h3 {
    margin: 0 0 8px;
    font-size: 14px;
}
.totp-instructions ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.totp-instructions li {
    margin: 4px 0;
    font-size: 13px;
    color: #555;
}

/* 二维码区域 */
.totp-qr-section {
    text-align: center;
    margin-bottom: 24px;
}
.totp-qr-section h3 {
    font-size: 15px;
    margin-bottom: 16px;
}
.totp-qr-wrap {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.totp-qr-img {
    width: 200px;
    height: 200px;
    display: block;
}
.totp-manual-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #888;
}
.totp-secret-code {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* ============================================================
   SMS 短信认证相关样式
   ============================================================ */

/* 短信提示图标 */
.sms-icon-hint {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 12px;
}
.sms-icon-hint p {
    margin-top: 12px;
    color: #666;
    font-size: 14px;
}

/* 验证码输入框 */
.sms-code-input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

/* 验证码行：输入框+发送按钮 */
.sms-code-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.sms-code-row .sms-code-input {
    max-width: 180px;
}
.sms-code-row .btn-outline {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
}
.sms-code-row .btn-outline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 验证码输入区 */
.totp-verify-section {
    max-width: 320px;
    margin: 0 auto;
}
.totp-verify-section h3 {
    text-align: center;
    font-size: 15px;
    margin-bottom: 16px;
}

/* 绑定成功页 */
.totp-verified-section {
    max-width: 560px;
    margin: 0 auto;
}
.totp-success-banner {
    text-align: center;
    padding: 24px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 20px;
}
.totp-success-banner h2 {
    margin: 12px 0 8px;
    color: #2e7d32;
    font-size: 20px;
}
.totp-success-banner p {
    color: #555;
    font-size: 14px;
}

/* 恢复码区域 */
.totp-backup-codes-box {
    background: #fff3e0;
    border: 2px dashed #ff9800;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.totp-backup-codes-box h3 {
    margin: 0 0 8px;
    font-size: 15px;
}
.totp-backup-codes-box .totp-warning {
    font-size: 13px;
    color: #e65100;
    margin: 0 0 16px;
}
.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.backup-code-item {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ffe0b2;
    letter-spacing: 2px;
}

/* 警告框 */
.totp-warning-box {
    background: #fffde7;
    border-left: 4px solid #fbc02d;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.totp-warning-box strong {
    display: block;
    margin-bottom: 8px;
}
.totp-warning-box ul {
    margin: 0;
    padding-left: 20px;
}
.totp-warning-box li {
    margin: 4px 0;
    font-size: 13px;
}

/* 个人设置页 — TOTP 状态徽章 */
.totp-status-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.totp-status-badge.totp-enabled {
    background: #e8f5e9;
    border: 1px solid #81c784;
}
.totp-status-badge.totp-enabled span:first-child {
    color: #2e7d32;
    font-weight: 600;
}
.totp-status-badge.totp-disabled {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}
.totp-status-badge.totp-disabled span:first-child {
    color: #757575;
    font-weight: 600;
}
.totp-status-badge.totp-none {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}
.totp-status-badge.totp-none span:first-child {
    color: #757575;
    font-weight: 600;
}
.totp-status-badge.totp-pending {
    background: #fff3e0;
    border: 1px solid #ffb74d;
}
.totp-status-badge.totp-pending span:first-child {
    color: #e65100;
    font-weight: 600;
}

/* 用户管理页 TOTP 状态标签 */
.totp-status-none { color: #9e9e9e; font-size: 12px; }
.totp-status-on { color: #2e7d32; font-weight: 600; font-size: 12px; }
.totp-status-pending { color: #e65100; font-weight: 600; font-size: 12px; }
.totp-status-off { color: #9e9e9e; font-size: 12px; }

/* 移动端 TOTP 适配 */
@media (max-width: 768px) {
    .backup-codes-grid {
        grid-template-columns: 1fr;
    }
    .totp-step-indicator {
        flex-wrap: wrap;
        gap: 4px;
    }
    .totp-step-line {
        width: 20px;
    }
    .totp-qr-img {
        width: 160px;
        height: 160px;
    }
}

/* ============================================================
   服务器运行状态监控
   ============================================================ */
.sys-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}
.sys-info-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border);
    gap: 10px;
}
.sys-info-item.sys-info-warning {
    background: #fff3f3;
    border-color: #f5c6cb;
}
.sys-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 70px;
    flex-shrink: 0;
}
.sys-info-value {
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
    font-weight: 500;
}
.sys-info-alert {
    margin-top: 10px;
    padding: 10px 16px;
    background: #fff3f3;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-size: 13px;
}

/* 磁盘空间不足弹窗增强 */
#disk-warning-modal .modal-box {
    animation: modal-fade-in 0.3s ease;
}
@keyframes modal-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   可视化磁盘浏览器
   ============================================================ */
.disk-browser-dialog {
    max-width: 900px;
    width: 95%;
}

.disk-browser-left {
    width: 260px;
    min-width: 240px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.disk-browser-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.disk-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.disk-card:hover { background: var(--bg-hover, #e8f4fd); }
.disk-card.active { background: #d4edda; border-left: 3px solid var(--success); }

.disk-card-icon { font-size: 22px; flex-shrink: 0; }
.disk-card-info { flex: 1; min-width: 0; }
.disk-card-name {
    font-size: 13px;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.disk-card-size { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.disk-card-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.disk-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.disk-pct-ok { background: var(--success, #28a745); }
.disk-pct-warning { background: #ffc107; }
.disk-pct-danger { background: #dc3545; }

/* 面包屑导航 */
.disk-browser-breadcrumb {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    white-space: nowrap;
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.bc-item { color: var(--primary); padding: 2px 4px; border-radius: 3px; }
.bc-item:hover { background: #e8f4fd; }
.bc-current { color: var(--text-primary); font-weight: 600; cursor: default !important; }
.bc-sep { color: var(--text-secondary); margin: 0 2px; }

/* 目录项 */
.disk-dir-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    margin-bottom: 2px;
}
.disk-dir-item:hover { background: var(--bg-hover, #e8f4fd); }
.disk-dir-item.active { background: #d4edda; }
.disk-dir-up { color: var(--text-secondary); font-style: italic; }
.disk-dir-icon { font-size: 18px; flex-shrink: 0; }
.disk-dir-name { flex: 1; font-size: 13px; }
.disk-dir-size { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }

/* 底部操作栏 */
.disk-browser-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .disk-browser-left { width: 180px; min-width: 160px; }
    .disk-browser-dialog { max-width: 100%; }
    .sys-info-grid {
        grid-template-columns: 1fr;
    }
    .sys-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .sys-info-label {
        min-width: auto;
    }
}

/* ===== 批量导入弹窗 ===== */
.disk-import-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s;
}
.disk-import-zone:hover { border-color: var(--primary); }
.disk-import-zone input[type="file"] { display: block; width: 100%; }
.disk-import-files-list { font-size: 12px; color: var(--primary); margin-top: 8px; word-break: break-all; }

/* ============================================================
   登录流程帮助弹窗
   ============================================================ */
.login-flow-modal-content {
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
}
.flow-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.flow-section-title {
    font-size: 15px;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.flow-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.flow-tag-on {
    background: #d4edda;
    color: #155724;
}
.flow-tag-off {
    background: #f8d7da;
    color: #721c24;
}
.flow-scope {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 10px 0;
    padding-left: 4px;
}
.flow-diagram {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}
.flow-node {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    min-width: 70px;
    min-height: 56px;
    line-height: 1.4;
}
.flow-node-start {
    background: #e7f3ff;
    border: 2px solid #1a73e8;
    color: #1a73e8;
}
.flow-node-check {
    background: #fff3cd;
    border: 2px solid #f0ad4e;
    color: #856404;
}
.flow-node-cond {
    background: #fff3cd;
    border: 2px solid #f0ad4e;
    color: #856404;
}
.flow-node-step {
    background: #e8daef;
    border: 2px solid #8e44ad;
    color: #6c3483;
}
.flow-node-success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    font-size: 13px;
}
.flow-node-err {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    font-size: 13px;
}
.flow-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    font-weight: bold;
    padding: 0 4px;
}
.flow-arrow-yes {
    font-size: 14px;
    color: var(--success);
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 2px 0;
}
.flow-note {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 10px;
}
.flow-summary {
    margin-top: 20px;
    background: var(--bg);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border);
}
.flow-summary table th {
    font-weight: 600;
    font-size: 12px;
}
.flow-summary table td {
    vertical-align: middle;
}

/* 报价帮助按钮 */
.btn-qa {
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: #856404;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-qa:hover {
    background: #ffc107;
    color: #333;
    border-color: #ff9800;
}

