/**
 * 设计协同系统 - 全局样式
 * 基于Ant Design设计规范的企业级B端系统，统一精致化样式
 */

/* ==================== 设计 Tokens ==================== */
:root {
    --radius-sm: 6px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
    --border-color: #e8e8e8;
    --bg-page: #f5f6f8;
    --bg-card: #ffffff;
    --bg-fill: #fafafa;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-tertiary: #8c8c8c;
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5715;
    color: var(--text-primary);
    background-color: var(--bg-page);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 布局容器 ==================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ==================== Header（顶部导航栏）==================== */
.app-header {
    height: 64px;
    background: #001529;
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 280px;
    position: relative;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 切换应用弹窗 */
.app-switcher-trigger {
    position: relative;
    cursor: pointer;
}
.app-switcher-trigger:hover .logo-wrapper { opacity: 0.9; }
.app-switcher-arrow {
    margin-left: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    transition: transform 0.2s;
}
.app-switcher-trigger[aria-expanded="true"] .app-switcher-arrow {
    transform: rotate(180deg);
}
.app-switcher-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 1100;
    display: none;
}
.app-switcher-popover.show {
    display: block;
}
.app-switcher-title {
    padding: 8px 16px;
    font-size: 12px;
    color: #8c8c8c;
    border-bottom: 1px solid #f0f0f0;
}
.app-switcher-list { padding: 4px 0; }
.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #262626;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.app-switcher-item:hover {
    background: #f5f5f5;
}
.app-switcher-item.active {
    background: #e6f7ff;
    color: #1890ff;
}
.app-switcher-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.app-switcher-item[data-app="procurement"] .app-switcher-icon { background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%); }
.app-switcher-item[data-app="supply-chain"] .app-switcher-icon { background: linear-gradient(135deg, #fa8c16 0%, #d46b08 100%); }
.app-switcher-item[data-app="equipment"] .app-switcher-icon { background: linear-gradient(135deg, #722ed1 0%, #531dab 100%); }
.app-switcher-item[data-app="energy"] .app-switcher-icon { background: linear-gradient(135deg, #13c2c2 0%, #08979c 100%); }
.app-switcher-name { flex: 1; }
.app-switcher-check {
    color: #1890ff;
    font-size: 14px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-search {
    width: 100%;
    max-width: 520px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 0 16px 0 40px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.45);
}

.search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    border-color: #1890ff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.45);
    font-size: 16px;
}

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

.header-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: color 0.3s;
    text-decoration: none;
}

.header-action:hover {
    color: white;
}

.action-icon {
    font-size: 20px;
}

.action-badge {
    position: relative;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4d4f;
    color: white;
    font-size: 12px;
    padding: 0 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 24px;
    border-left: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-detail {
    text-align: right;
}

.user-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

.user-role {
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    line-height: 1.2;
}

/* ==================== Sidebar（左侧菜单栏）==================== */
.sidebar-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-sidebar {
    width: 200px;
    background: linear-gradient(180deg, #001529 0%, #001a33 100%);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu {
    padding: 12px 0 24px;
}

.menu-section {
    margin-bottom: 4px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-item,
.menu-item-parent {
    display: flex;
    align-items: center;
    margin: 0 8px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-radius 0.2s;
    text-decoration: none;
    position: relative;
    border-radius: 6px;
    min-height: 40px;
    box-sizing: border-box;
}

.menu-item:hover,
.menu-item-parent:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.menu-item.active {
    color: #fff;
    background: #1890ff;
}

.menu-item.active:hover {
    background: #40a9ff;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}

.menu-item-parent.expanded {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.05);
}

.menu-item-parent.expanded .menu-arrow {
    color: #1890ff;
}

.menu-icon {
    margin-right: 10px;
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.9;
}

.menu-item.active .menu-icon,
.menu-item-parent.expanded .menu-icon {
    opacity: 1;
}

.menu-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.25s ease;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.menu-item-parent.expanded .menu-arrow {
    transform: rotate(90deg);
}

a.menu-item-link {
    text-decoration: none;
    color: rgba(255,255,255,0.75);
}
a.menu-item-link:visited {
    color: rgba(255,255,255,0.75);
}
a.menu-item-link:hover {
    color: #fff;
}
a.menu-item-link.active {
    color: #fff;
}
a.menu-item-link.active:hover {
    color: #fff;
}

.submenu {
    background: rgba(0,12,23,0.6);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    border-left: 1px solid rgba(24,144,255,0.15);
    margin-left: 16px;
    margin-top: 2px;
    border-radius: 0 0 0 4px;
    opacity: 0;
    visibility: hidden;
    display: block; /* 确保元素始终在文档流中 */
}

.menu-section .submenu.open,
.submenu.open {
    max-height: 1200px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px 8px 32px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    border-radius: 4px;
    margin: 2px 8px 2px 4px;
    min-height: 36px;
    box-sizing: border-box;
}

.submenu-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.submenu-item.active {
    color: #fff;
    background: rgba(24,144,255,0.2);
}

.submenu-item.active:hover {
    background: rgba(24,144,255,0.28);
}

/* ==================== Main Content（右侧内容区）==================== */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-page);
}

.content-wrapper {
    padding: 24px 28px 32px;
    min-height: calc(100vh - 64px);
    max-width: 1600px;
    margin: 0 auto;
}

/* 页面头部：面包屑 + 说明（红框区域） */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.breadcrumb-item {
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #1890ff;
}

.breadcrumb-separator {
    margin: 0 6px;
    color: #d9d9d9;
    user-select: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb a {
    text-decoration: none;
}

.page-header {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--bg-fill);
    border-left: 4px solid #1890ff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
    margin-bottom: 8px;
}

.page-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ==================== 卡片组件 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-fill);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-extra {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 24px 28px;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-fill);
}

/* ==================== 表单组件 ==================== */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-col {
    flex: 1;
}

.form-item {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.form-label.required::before {
    content: '*';
    color: #ff4d4f;
    margin-right: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-card);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.12);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-input[disabled],
.form-select[disabled],
.form-textarea[disabled] {
    background: #f5f5f5;
    cursor: not-allowed;
    color: rgba(0,0,0,0.25);
}

/* ==================== 按钮组件 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #40a9ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.25);
}

.btn-default {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-default:hover:not(:disabled) {
    border-color: #40a9ff;
    color: #40a9ff;
    background: #f0f8ff;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #73d13d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #ff7875;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #ffc53d;
}

.btn-link {
    background: transparent;
    color: #1890ff;
    padding: 0 8px;
}

.btn-link:hover:not(:disabled) {
    color: #40a9ff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ==================== 表格组件 ==================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.table-wrapper table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto !important;
    min-width: 100%;
}

.table-wrapper thead {
    background: #f8f9fa;
}

.table-wrapper th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

/* 操作列：表头与表体右内边距一致，避免横向线条错位 */
.table-wrapper th:last-child {
    padding-right: 20px;
}

/* 复选框列居中 */
.table-wrapper th[width="40"] {
    width: 40px;
    text-align: center;
    padding-left: 12px;
    padding-right: 12px;
}

.table-wrapper table:has(thead th[width="40"]) td:first-child {
    width: 40px;
    text-align: center;
    padding-left: 12px;
    padding-right: 12px;
}

.table-wrapper td {
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 操作列：强制自适应宽度，覆盖所有HTML width属性和其他CSS规则 - 全局生效 */
/* 优先级最高，确保所有表格的操作列都自适应 */
.table-wrapper th:last-child,
.table-wrapper th:last-child[width],
.table-wrapper table th:last-child,
.table-wrapper table th:last-child[width],
table th:last-child,
table th:last-child[width] {
    width: 1% !important;
    max-width: none !important;
    min-width: auto !important;
    padding-right: 20px;
    white-space: nowrap !important;
}
.table-wrapper td:last-child,
.table-wrapper td:last-child[width],
.table-wrapper table td:last-child,
.table-wrapper table td:last-child[width],
table td:last-child,
table td:last-child[width] {
    padding-right: 20px;
    white-space: nowrap !important;
    overflow: visible !important;
    width: 1% !important;
    max-width: none !important;
    min-width: auto !important;
}

.table-wrapper td:last-child .btn,
.table-wrapper td:last-child a.btn {
    display: inline-block;
    margin-right: 8px;
}
.table-wrapper td:last-child .btn:last-child,
.table-wrapper td:last-child a.btn:last-child {
    margin-right: 0;
}

/* 列表页（如订单管理、客户档案）：强制操作列为 table-cell，横向线条与整表对齐 */
.card > .table-wrapper th,
.card > .table-wrapper td {
    box-sizing: border-box;
}
.card > .table-wrapper th:last-child,
.card > .table-wrapper td:last-child {
    display: table-cell !important;
    padding-right: 20px;
}

/* 列表操作列按钮：统一无底色，用字体颜色区分 */
.table-wrapper tbody td:last-child .btn-sm.btn-default,
.table-wrapper tbody td:last-child .btn-sm.btn-primary,
.table-wrapper tbody td:last-child .btn-sm.btn-danger {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.table-wrapper tbody td:last-child .btn-sm.btn-primary,
.table-wrapper tbody td:last-child .btn-sm.btn-default {
    color: #1890ff;
}
.table-wrapper tbody td:last-child .btn-sm.btn-danger {
    color: #ff4d4f;
}
.table-wrapper tbody td:last-child .btn-sm:hover {
    background: transparent !important;
    box-shadow: none !important;
}
.table-wrapper tbody td:last-child .btn-sm.btn-primary:hover,
.table-wrapper tbody td:last-child .btn-sm.btn-default:hover {
    color: #40a9ff;
}
.table-wrapper tbody td:last-child .btn-sm.btn-danger:hover {
    color: #ff7875;
}

.table-wrapper tbody tr {
    transition: background 0.15s ease;
}

.table-wrapper tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.table-wrapper tbody tr:hover {
    background: #f5f8fc !important;
}

/* 订单管理列表：主表选中行区分（SPA 注入时页面 style 不包含，故放全局） */
.order-list-table tbody tr.order-list-row {
    cursor: pointer;
}
.order-list-table tbody tr.order-list-row:hover {
    background: #f5f5f5 !important;
}
.order-list-table tbody tr.order-list-row.selected {
    background: #e6f7ff !important;
    border-left: 3px solid #1890ff;
    box-shadow: inset 0 0 0 1px rgba(24, 144, 255, 0.2);
}
.order-list-table tbody tr.order-list-row.selected:hover {
    background: #bae7ff !important;
}

/* 版本管理：行选中高亮 */
.bom-list-row.selected { background-color: rgba(24, 144, 255, 0.06); }
.bom-version-row.selected,
.mbom-version-row.selected,
.sbom-version-row.selected {
    background: #e6f7ff !important;
}

.table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

/* 列表表格通用优化：禁止单元格自动换行、超长省略号、横向滚动（SPA/直接打开均生效） */
/* 全局应用：所有表格默认使用auto布局，操作列自适应 */
.table-wrapper table,
.table-wrapper .list-table-nowrap,
.table-wrapper .procurement-order-list-table {
    table-layout: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
}
/* 操作列宽度自适应内容 - 最高优先级，覆盖所有情况 */
.table-wrapper .list-table-nowrap th:last-child,
.table-wrapper .procurement-order-list-table th:last-child,
.table-wrapper table th:last-child {
    width: auto !important;
    max-width: none !important;
    min-width: auto !important;
}
.table-wrapper .list-table-nowrap td:last-child,
.table-wrapper .procurement-order-list-table td:last-child,
.table-wrapper table td:last-child {
    width: auto !important;
    max-width: none !important;
    min-width: auto !important;
}
.table-wrapper .list-table-nowrap th,
.table-wrapper .list-table-nowrap td,
.table-wrapper .procurement-order-list-table th,
.table-wrapper .procurement-order-list-table td,
.table-wrapper table th,
.table-wrapper table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.table-wrapper .list-table-nowrap td:last-child,
.table-wrapper .procurement-order-list-table td:last-child,
.table-wrapper table td:last-child {
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: left;
    padding-right: 20px !important;
    padding-left: 12px !important;
    width: 1% !important;
    max-width: none !important;
    min-width: auto !important;
}
.table-wrapper .list-table-nowrap th:last-child,
.table-wrapper .procurement-order-list-table th:last-child,
.table-wrapper table th:last-child {
    padding-right: 20px !important;
    padding-left: 12px !important;
    width: 1% !important;
    max-width: none !important;
    white-space: nowrap !important;
}
/* 操作列背景色：统一使用与表格行相同的背景色，避免白色块 - 全局应用 */
.table-wrapper .list-table-nowrap tbody tr:nth-child(odd) td:last-child,
.table-wrapper .procurement-order-list-table tbody tr:nth-child(odd) td:last-child,
.table-wrapper table tbody tr:nth-child(odd) td:last-child {
    background: #fff !important;
}
.table-wrapper .list-table-nowrap tbody tr:nth-child(even) td:last-child,
.table-wrapper .procurement-order-list-table tbody tr:nth-child(even) td:last-child,
.table-wrapper table tbody tr:nth-child(even) td:last-child {
    background: #fcfcfd !important;
}
.table-wrapper .list-table-nowrap tbody tr:hover td:last-child,
.table-wrapper .procurement-order-list-table tbody tr:hover td:last-child,
.table-wrapper table tbody tr:hover td:last-child {
    background: #f5f7fa !important;
}

/* 表内复选框 */
.table-wrapper th input[type="checkbox"],
.table-wrapper td input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

/* 空数据占位单元格 */
.table-wrapper td.table-empty-cell,
.table-wrapper td[colspan] {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.table-wrapper td[colspan]:has(.empty-state) {
    padding: 20px 24px;
}

.table-wrapper td[colspan] .empty-state {
    margin: 0;
}

/* ==================== 消息列表 ==================== */
.msg-list.card {
    padding: 0;
    overflow: hidden;
}

.msg-list .msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 28px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    cursor: pointer;
}

.msg-list .msg-row:hover {
    background: #fafafa;
}

.msg-list .msg-row.unread {
    background: #f0f7ff;
}

.msg-list .msg-row.unread:hover {
    background: #e6f2ff;
}

.msg-list .msg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1890ff;
    flex-shrink: 0;
    margin-top: 6px;
}

.msg-list .msg-row.read .msg-dot {
    display: none;
}

.msg-list .msg-body {
    flex: 1;
    min-width: 0;
}

.msg-list .msg-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 12px;
    color: rgba(0,0,0,0.45);
}

.msg-list .msg-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.msg-list .msg-type.task {
    background: #e6f7ff;
    color: #1890ff;
}

.msg-list .msg-type.review {
    background: #fff7e6;
    color: #fa8c16;
}

.msg-list .msg-type.change {
    background: #f9f0ff;
    color: #722ed1;
}

.msg-list .msg-type.system {
    background: #f5f5f5;
    color: rgba(0,0,0,0.65);
}

.msg-list .msg-title {
    font-size: 14px;
    color: rgba(0,0,0,0.85);
    margin-bottom: 4px;
    font-weight: 400;
}

.msg-list .msg-row.unread .msg-title {
    font-weight: 600;
}

.msg-list .msg-preview {
    font-size: 13px;
    color: rgba(0,0,0,0.45);
    line-height: 1.5;
}

.msg-list .msg-time {
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(0,0,0,0.45);
}

.msg-list .msg-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.msg-list .msg-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
}

.msg-list .msg-list-body .msg-row:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .msg-list .msg-row {
        flex-wrap: wrap;
        padding: 12px 16px;
    }
    .msg-list .msg-time {
        width: 100%;
        order: 1;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px dashed #f0f0f0;
    }
    .msg-list .msg-actions {
        width: 100%;
        order: 2;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* ==================== 状态标签 ==================== */
/* 制造业ERP状态标签颜色规范：
   - 草稿：灰色 (tag-default)
   - 已提交/待审核：黄色 (tag-warning)
   - 执行中/进行中：绿色 (tag-success)
   - 已完成：绿色 (tag-success)
   - 已取消/已关闭：红色 (tag-error)
*/
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
}

/* 草稿状态 - 灰色 */
.status-draft {
    background: #f5f5f5;
    color: rgba(0,0,0,0.45);
}

/* 已提交/待审核状态 - 黄色 */
.status-pending,
.status-submitted {
    background: #fffbe6;
    color: #faad14;
}

/* 执行中/进行中状态 - 绿色 */
.status-processing,
.status-inprogress,
.status-in-progress {
    background: #f6ffed;
    color: #52c41a;
}

/* 已完成状态 - 绿色 */
.status-success,
.status-completed,
.status-done {
    background: #f6ffed;
    color: #52c41a;
}

/* 已取消/已关闭/错误状态 - 红色 */
.status-error,
.status-cancelled,
.status-canceled,
.status-closed,
.status-rejected {
    background: #fff2f0;
    color: #ff4d4f;
}

/* 警告状态 - 黄色（用于提醒类状态） */
.status-warning {
    background: #fffbe6;
    color: #faad14;
}

/* 已发布状态 - 蓝色 */
.status-published,
.status-released {
    background: #e6f7ff;
    color: #1890ff;
}

/* 审核中状态 - 橙色 */
.status-reviewing,
.status-checking {
    background: #fff7e6;
    color: #fa8c16;
}

/* 驳回状态 - 红色 */
.status-rejected,
.status-returned {
    background: #fff2f0;
    color: #ff4d4f;
}

/* 已归档状态 - 灰色 */
.status-archived {
    background: #f5f5f5;
    color: #8c8c8c;
}

/* 版本发布状态：待发布 - 黄色 */
.status-pending-publish {
    background: #fffbe6;
    color: #faad14;
}

/* 版本发布状态：发布中 - 蓝色 */
.status-publishing {
    background: #e6f7ff;
    color: #1890ff;
}

/* 版本发布状态：发布失败 - 红色 */
.status-publish-failed {
    background: #fff2f0;
    color: #ff4d4f;
}

/* 使用中状态 - 绿色 */
.status-using {
    background: #f6ffed;
    color: #52c41a;
}

/* 未使用状态 - 灰色 */
.status-not-executed { background: #f5f5f5; color: #8c8c8c; }
.status-exec-draft { background: #e6f7ff; color: #1890ff; }
.status-exec-reviewing { background: #fff7e6; color: #fa8c16; }
.status-exec-approved { background: #f6ffed; color: #52c41a; }
.status-exec-rejected { background: #fff2f0; color: #ff4d4f; }
.status-unused {
    background: #f5f5f5;
    color: #8c8c8c;
}

/* ==================== 优先级标签 ==================== */
.priority-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.priority-high {
    background: #fff2f0;
    color: #ff4d4f;
}

.priority-medium {
    background: #fff7e6;
    color: #fa8c16;
}

.priority-low {
    background: #f6ffed;
    color: #52c41a;
}

/* ==================== 徽章标签 ==================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-default {
    background: #f5f5f5;
    color: rgba(0, 0, 0, 0.45);
    border: 1px solid #d9d9d9;
}

.badge-primary {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

/* ==================== 任务性质标签 ==================== */
.task-nature-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.nature-sample {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffe58f;
}

.nature-formal {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

/* ==================== BOM 来源标签（上游下推 vs 手动/导入） ==================== */
.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.source-tag.source-push,
.source-tag.source-ebom,
.source-tag.source-mbom,
.source-tag.source-sample {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}
.source-tag.source-manual,
.source-tag.source-copy,
.source-tag.source-import {
    background: #f5f5f5;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-title {
    color: rgba(0,0,0,0.45);
    font-size: 14px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: #e6f7ff;
    color: #1890ff;
}

.stat-icon.green {
    background: #f6ffed;
    color: #52c41a;
}

.stat-icon.orange {
    background: #fff7e6;
    color: #fa8c16;
}

.stat-icon.red {
    background: #fff2f0;
    color: #ff4d4f;
}

.stat-icon.purple {
    background: #f9f0ff;
    color: #722ed1;
}

.stat-content {
    margin-top: 12px;
}

.stat-label {
    font-size: 14px;
    color: rgba(0,0,0,0.45);
    margin-bottom: 4px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-stats .stat-card {
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    transition: box-shadow 0.2s, transform 0.2s;
}

.dashboard-stats .stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.dashboard-todo .todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin: 0 -28px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.dashboard-todo .todo-item:last-child {
    border-bottom: none;
}

.dashboard-todo .todo-item:hover {
    background: #fafbfc;
}

.todo-main {
    display: flex;
    flex-direction: column;
}

.todo-title {
    font-weight: 500;
}

.todo-desc {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
    line-height: 1.2;
}

.stat-trend {
    font-size: 12px;
    margin-top: 8px;
    color: rgba(0,0,0,0.45);
}

.stat-trend.up {
    color: #52c41a;
}

.stat-trend.down {
    color: #ff4d4f;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.filter-item .form-input,
.filter-item .form-select {
    min-width: 140px;
}

.filter-item.filter-item--wide .form-input {
    min-width: 200px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.filter-actions .btn {
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ==================== 操作栏 ==================== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-right {
    display: flex;
    gap: 8px;
}

.action-tip {
    color: var(--text-tertiary);
    font-size: 13px;
    margin-right: 12px;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.filter-checkbox input {
    margin: 0;
}

/* ==================== Tabs组件 ==================== */
.tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-list {
    display: flex;
    gap: 24px;
}

.tab-item {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.tab-content {
    padding: 16px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ==================== 详情页：表单信息、区块、产出物表 ==================== */
.form-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 24px;
}

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

.form-info-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.form-info-value {
    font-size: 14px;
    color: var(--text-primary);
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.desc-box {
    padding: 12px;
    background: var(--bg-fill);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.output-table,
.bom-structure-table {
    width: 100%;
    border-collapse: collapse;
}

.output-table th,
.output-table td,
.bom-structure-table th,
.bom-structure-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.output-table th,
.bom-structure-table th {
    background: var(--bg-fill);
    color: var(--text-secondary);
    font-weight: 500;
}

.output-table .cell-actions,
.bom-structure-table .cell-actions {
    display: flex;
    gap: 8px;
}

.bom-structure-table .col-level { width: 60px; }
.bom-structure-table .col-qty { width: 80px; }
.bom-structure-table .col-unit { width: 56px; }
.bom-structure-table .col-key { width: 80px; }

.bom-structure-table.bom-readonly { font-size: 13px; }
.bom-structure-table.bom-readonly th,
.bom-structure-table.bom-readonly td { padding: 8px 12px; }
.bom-structure-table.bom-readonly .col-no { width: 44px; text-align: center; }
.bom-structure-table.bom-readonly .col-level { width: 60px; text-align: left; white-space: nowrap; }
.bom-structure-table.bom-readonly .col-qty { width: 56px; text-align: right; }
.bom-structure-table.bom-readonly .col-unit { width: 48px; }
.bom-structure-table.bom-readonly .col-key { width: 52px; text-align: center; }
.bom-structure-table.bom-readonly .col-loss { width: 56px; text-align: right; }
.bom-structure-table.bom-readonly .col-supplier { width: 90px; }
.bom-structure-table.bom-readonly .col-price { width: 72px; text-align: right; }
.bom-structure-table.bom-readonly .col-remark { width: 80px; }
.bom-structure-table.bom-readonly .col-owner { width: 56px; color: var(--text-tertiary); font-size: 12px; }

/* MBOM 详情 BOM 明细：工序号、加工方式、工艺流程、工装工具、发料仓库、替代料 */
.bom-structure-table.bom-readonly.mbom-detail-bom .col-op { width: 52px; text-align: center; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-station { width: 52px; text-align: center; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-method { width: 90px; min-width: 80px; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-flow { width: 120px; min-width: 100px; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-tool { width: 90px; min-width: 80px; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-wh { width: 80px; }
.bom-structure-table.bom-readonly.mbom-detail-bom .col-alt { width: 80px; }

/* SBOM 详情 BOM 明细：维修要求、配件替代 */
.bom-structure-table.bom-readonly.sbom-detail-bom .col-repair { width: 140px; min-width: 120px; }
.bom-structure-table.bom-readonly.sbom-detail-bom .col-alt { width: 90px; }

/* 设计任务详情：BOM / 图纸附件 Tab 切换（纯 CSS radio+label，不依赖 JS） */
.card-header-with-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header-with-tabs .card-title { margin: 0; }
.dt-detail-tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    border-radius: var(--radius-sm);
    background: var(--bg-fill);
    border: 1px solid var(--border-color);
}
.dt-detail-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.dt-detail-tab:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.dt-detail-tab input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
#dt-bom-attach-card:has(.dt-detail-tab input[value="bom"]:checked) .dt-detail-tab:has(input[value="bom"]),
#dt-bom-attach-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab:has(input[value="attach"]) {
    color: var(--primary-color, #1890ff);
    font-weight: 500;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.dt-detail-tabs { margin-top: 0; }
.dt-detail-tab-pane { display: none; padding-top: 16px; }
.dt-detail-tab-pane[data-tab="bom"] { display: block; }
.dt-detail-tab-pane[data-tab="attach"] { display: none; }
@supports selector(:has(*)) {
    .dt-detail-tab-pane[data-tab="bom"],
    .dt-detail-tab-pane[data-tab="attach"] { display: none; }
    #dt-bom-attach-card:has(.dt-detail-tab input[value="bom"]:checked) .dt-detail-tab-pane[data-tab="bom"] { display: block; }
    #dt-bom-attach-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab-pane[data-tab="attach"] { display: block; }
}

.dt-attach-table { font-size: 13px; }
.dt-attach-table th,
.dt-attach-table td { padding: 8px 12px; }
.dt-attach-table .cell-actions { display: flex; gap: 8px; flex-wrap: nowrap; }

/* BOM 详情页通用 Tab（EBOM/MBOM/SBOM） */
.bom-detail-tabs-card .dt-detail-tab-pane { display: none; padding-top: 16px; }
.bom-detail-tabs-card .dt-detail-tab-pane[data-tab="bom"] { display: block; }
@supports selector(:has(*)) {
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="bom"],
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="process"],
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="attach"],
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="version"],
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="change"],
    .bom-detail-tabs-card .dt-detail-tab-pane[data-tab="repair"] { display: none; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="bom"]:checked) .dt-detail-tab-pane[data-tab="bom"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="process"]:checked) .dt-detail-tab-pane[data-tab="process"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab-pane[data-tab="attach"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="version"]:checked) .dt-detail-tab-pane[data-tab="version"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="change"]:checked) .dt-detail-tab-pane[data-tab="change"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="repair"]:checked) .dt-detail-tab-pane[data-tab="repair"] { display: block; }
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="bom"]:checked) .dt-detail-tab:has(input[value="bom"]),
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="process"]:checked) .dt-detail-tab:has(input[value="process"]),
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab:has(input[value="attach"]),
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="version"]:checked) .dt-detail-tab:has(input[value="version"]),
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="change"]:checked) .dt-detail-tab:has(input[value="change"]),
    .bom-detail-tabs-card:has(.dt-detail-tab input[value="repair"]:checked) .dt-detail-tab:has(input[value="repair"]) {
        color: var(--primary-color, #1890ff); font-weight: 500; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    }
}

.section-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ==================== 设计工作台：紧凑树形 BOM + 可收起详情 ==================== */
.content-wrapper.workbench-page {
    padding: 12px 16px 16px;
}

.content-wrapper.workbench-page .breadcrumb {
    margin-bottom: 8px;
}

.content-wrapper.workbench-page .page-header {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.content-wrapper.workbench-page .page-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* EBOM/SBOM 工作台专有卡片（技术要求、维修要求），全屏时不进入 wrap，求同存异 */
.workbench-extra-card {
    margin-top: 12px;
}

.workbench-task-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.workbench-task-bar .task-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.workbench-task-bar .task-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.workbench-task-bar .task-meta strong,
.workbench-task-bar .task-meta a {
    color: var(--text-primary);
    font-weight: 600;
}

.workbench-task-bar .task-meta a:hover {
    color: #1890ff;
}

.workbench-task-bar .task-meta-sep {
    color: #d9d9d9;
    font-weight: 300;
    user-select: none;
}

.workbench-task-bar .task-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workbench-task-bar .task-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
}

.workbench-layout {
    display: flex;
    gap: 12px;
    align-items: stretch;
    min-height: 70vh;
}

.workbench-tree-wrap {
    flex: 1;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.workbench-tree-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f6f8 100%);
    flex-shrink: 0;
}

.workbench-tree-toolbar .tree-toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
}

.workbench-tree-toolbar .tree-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.workbench-tree-toolbar .tree-toolbar-sep {
    margin: 0 4px;
    color: #d9d9d9;
    font-size: 12px;
    font-weight: 300;
}

.workbench-tree-toolbar .tree-actions .btn {
    padding: 5px 12px;
    font-size: 12px;
}

.workbench-tree-toolbar .tree-batch-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
}

.workbench-tree-toolbar .tree-batch-bar .batch-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.workbench-tree-toolbar .tree-batch-bar .batch-info strong {
    color: #1890ff;
}

.workbench-tree-body {
    flex: 1;
    overflow: auto;
    min-height: 55vh;
}

/* BOM 树下方：附件列表 / 可替换物料 - 初始高度较小，BOM 树占据更多空间以展示海量数据 */
.wb-below-tree-card {
    flex-shrink: 0;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    max-height: 200px;
}
.wb-below-tree-card .card-header {
    padding: 10px 16px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f6f8 100%);
}
.wb-below-tree-card .card-body { padding: 10px 16px; min-height: 0; }
.wb-below-tree-card .wb-below-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.wb-below-tree-card .wb-below-toolbar .btn {
    padding: 5px 12px;
    font-size: 13px;
}
.wb-below-tree-card .wb-below-hint {
    font-size: 12px;
    color: var(--text-tertiary);
}
.wb-below-tree-card .table-wrapper {
    max-height: 110px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.wb-below-tree-card .output-table th,
.wb-below-tree-card .output-table td {
    padding: 6px 10px;
    font-size: 12px;
}
.wb-below-tree-card .empty-hint {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    background: var(--bg-fill);
    border-radius: var(--radius-sm);
}

/* wb-below-tree 的 Tab 切换：附件列表 / 可替换物料 */
.wb-below-tree-card .dt-detail-tab-pane { display: none; padding-top: 0; }
.wb-below-tree-card .dt-detail-tab-pane[data-tab="attach"] { display: block; }
@supports selector(:has(*)) {
    .wb-below-tree-card .dt-detail-tab-pane[data-tab="attach"],
    .wb-below-tree-card .dt-detail-tab-pane[data-tab="replace"] { display: none; }
    .wb-below-tree-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab-pane[data-tab="attach"] { display: block; }
    .wb-below-tree-card:has(.dt-detail-tab input[value="replace"]:checked) .dt-detail-tab-pane[data-tab="replace"] { display: block; }
    .wb-below-tree-card:has(.dt-detail-tab input[value="attach"]:checked) .dt-detail-tab:has(input[value="attach"]),
    .wb-below-tree-card:has(.dt-detail-tab input[value="replace"]:checked) .dt-detail-tab:has(input[value="replace"]) {
        color: var(--primary-color, #1890ff); font-weight: 500; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    }
}

.bom-tree-row.row-hidden {
    display: none;
}

.bom-tree {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bom-tree thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f6f8 100%);
}

.bom-tree th {
    padding: 8px 10px;
    text-align: left;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 12px;
}

.bom-tree td {
    padding: 6px 10px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.bom-tree tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.bom-tree tbody tr:hover {
    background: #f8fafc;
}

.bom-tree tbody tr.selected {
    background: #e6f7ff;
    box-shadow: inset 3px 0 0 #1890ff;
}

.bom-tree tbody tr.locked:hover {
    background: #fafafa;
}

.bom-tree .tree-cell {
    display: flex;
    align-items: center;
    gap: 2px;
}
.bom-tree .tree-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 0 2px;
    user-select: none;
}
.bom-tree .tree-drag-handle:hover {
    color: var(--text-secondary);
}
.bom-tree .tree-drag-handle:active {
    cursor: grabbing;
}
.bom-tree-row.bom-tree-dragging {
    opacity: 0.5;
}

.bom-tree .tree-indent {
    width: 16px;
    flex-shrink: 0;
    display: inline-block;
}

.bom-tree .tree-indent.tree-indent-l2 { width: 32px; }
.bom-tree .tree-indent.tree-indent-l3 { width: 48px; }
.bom-tree .tree-indent.tree-indent-l4 { width: 64px; }

.bom-tree .tree-toggle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 10px;
    user-select: none;
}

.bom-tree .tree-toggle.empty {
    visibility: hidden;
    pointer-events: none;
}

.bom-tree .tree-toggle.expanded {
    transform: rotate(90deg);
}

.bom-tree .tree-toggle:not(.empty) {
    cursor: pointer;
}

.bom-tree .col-check { width: 36px; text-align: center; }
.bom-tree .col-check input { cursor: pointer; }
.bom-tree .col-no { width: 44px; text-align: center; }
.bom-tree .col-level { width: 60px; text-align: center; white-space: nowrap; }
.bom-tree .col-qty { width: 56px; }
.bom-tree .col-unit { width: 48px; }
.bom-tree .col-key { width: 52px; text-align: center; }
.bom-tree .col-replace { width: 70px; text-align: center; }
.bom-tree .col-loss { width: 56px; }
.bom-tree .col-supplier { width: 90px; }
.bom-tree .col-price { width: 72px; }
.bom-tree .col-remark { width: 80px; }
.bom-tree .col-owner { width: 56px; color: var(--text-tertiary); font-size: 11px; }
.bom-tree .col-actions { width: 1px; white-space: nowrap; }

.bom-tree .bom-input-sm {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bom-tree .bom-input-sm:hover {
    border-color: #bfbfbf;
}
.bom-tree .bom-input-sm:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}
.bom-tree .bom-input-sm[type="number"] { text-align: right; }
.bom-tree .col-loss .bom-input-sm,
.bom-tree .col-price .bom-input-sm { min-width: 48px; }

.bom-tree .bom-qty-input,
.bom-tree .bom-unit-select {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.bom-tree .bom-qty-input:hover,
.bom-tree .bom-unit-select:hover {
    border-color: #bfbfbf;
}
.bom-tree .bom-qty-input:focus,
.bom-tree .bom-unit-select:focus {
    outline: none;
    border-color: #1890ff;
}

.bom-tree .bom-qty-input { text-align: right; }
.bom-tree .bom-unit-select { min-width: 0; }
.bom-tree .bom-key-check { margin: 0; cursor: pointer; }
.bom-tree .bom-attach-btn { padding: 2px 6px; font-size: 11px; }

.bom-tree .owner-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    background: #e6f7ff;
    color: #1890ff;
}

.bom-tree .owner-tag.other {
    background: #f5f5f5;
    color: var(--text-tertiary);
}

.bom-tree-row.locked .col-actions button {
    display: none;
}

.bom-tree-row.locked .col-actions .lock-hint {
    font-size: 10px;
    color: var(--text-tertiary);
}

.bom-tree .cell-act {
    display: inline-flex;
    gap: 4px;
}

.bom-tree .cell-act .btn {
    padding: 3px 8px;
    font-size: 12px;
}

.bom-tree-row.drag-over {
    background: #e6f7ff !important;
    outline: 2px dashed #1890ff;
    outline-offset: -1px;
}

.bom-tree-body.droppable {
    min-height: 120px;
}

.workbench-material-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.workbench-material-panel .panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f6f8 100%);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.workbench-material-panel .panel-toolbar {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workbench-material-panel .material-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}
.workbench-material-panel .material-search:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}

.workbench-material-panel .material-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workbench-material-panel .material-filters .form-select {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    font-size: 12px;
}

.workbench-material-panel .panel-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.workbench-material-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 工作台全屏（设计工作台 / MBOM / EBOM / SBOM 共用）：任务栏 + BOM 树 + 物料面板，铺满视口、浅色背景、主区撑满。求同存异，格式样式统一。 */
.workbench-fullscreen-wrap:fullscreen,
.workbench-fullscreen-wrap:-webkit-full-screen,
.workbench-fullscreen-wrap:-moz-full-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    padding: 16px 20px;
    box-sizing: border-box;
    background: #f5f6f8 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    overflow: hidden !important;
}

.workbench-fullscreen-wrap:fullscreen .workbench-task-bar,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-task-bar,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-task-bar {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.workbench-fullscreen-wrap:fullscreen .workbench-layout,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-layout,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-layout {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    gap: 12px;
    align-items: stretch;
    overflow: hidden;
    background: #f5f6f8;
}

.workbench-fullscreen-wrap:fullscreen .workbench-tree-wrap,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-tree-wrap,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-tree-wrap {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workbench-fullscreen-wrap:fullscreen .workbench-tree-toolbar,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-tree-toolbar,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-tree-toolbar {
    flex-shrink: 0;
}

.workbench-fullscreen-wrap:fullscreen .workbench-tree-body,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-tree-body,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-tree-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
}

.workbench-fullscreen-wrap:fullscreen .workbench-material-panel,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-material-panel,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-material-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.workbench-fullscreen-wrap:fullscreen .workbench-material-panel .panel-header,
.workbench-fullscreen-wrap:fullscreen .workbench-material-panel .panel-toolbar,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-material-panel .panel-header,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-material-panel .panel-toolbar,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-material-panel .panel-header,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-material-panel .panel-toolbar {
    flex-shrink: 0;
}

.workbench-fullscreen-wrap:fullscreen .workbench-material-list,
.workbench-fullscreen-wrap:-webkit-full-screen .workbench-material-list,
.workbench-fullscreen-wrap:-moz-full-screen .workbench-material-list {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
}

/* 全屏下弹窗置于最前；弹窗已移入 fullscreen-wrap 内，全屏时可见 */
.workbench-fullscreen-wrap:fullscreen .modal-overlay.active,
.workbench-fullscreen-wrap:-webkit-full-screen .modal-overlay.active,
.workbench-fullscreen-wrap:-moz-full-screen .modal-overlay.active,
.workbench-fullscreen-wrap.wb-fullscreen-active .modal-overlay.active {
    z-index: 9999;
}

/* 全屏样式 class 回退（:fullscreen 未生效时由 JS 切换 class 保证布局/背景） */
.workbench-fullscreen-wrap.wb-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    padding: 16px 20px;
    box-sizing: border-box;
    background: #f5f6f8 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    overflow: hidden !important;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-task-bar {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-layout {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    gap: 12px;
    align-items: stretch;
    overflow: hidden;
    background: #f5f6f8;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-tree-wrap {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-tree-toolbar {
    flex-shrink: 0;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-tree-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-material-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-material-panel .panel-header,
.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-material-panel .panel-toolbar {
    flex-shrink: 0;
}

.workbench-fullscreen-wrap.wb-fullscreen-active .workbench-material-list {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    cursor: grab;
    transition: background 0.15s;
}

.material-item:hover {
    background: #f0f7ff;
}

.material-item:active {
    cursor: grabbing;
}

.material-item .mat-code {
    flex-shrink: 0;
    width: 56px;
    color: var(--text-secondary);
    font-size: 11px;
}

.material-item .mat-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-item .mat-unit {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-tertiary);
}

.workbench-detail {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.2s, min-width 0.2s;
}

.workbench-detail.collapsed {
    width: 36px;
    min-width: 36px;
}

.workbench-detail.collapsed .workbench-detail-body,
.workbench-detail.collapsed .workbench-detail-header .detail-title,
.workbench-detail.collapsed .workbench-detail-header .detail-toggle-collapse {
    display: none;
}

.workbench-detail.collapsed .workbench-detail-header {
    padding: 6px;
    justify-content: center;
    border-bottom: none;
}

.workbench-detail.collapsed .detail-toggle-expand {
    padding: 4px 8px;
    font-size: 12px;
}

.workbench-detail.collapsed .workbench-detail-header .detail-toggle-expand {
    display: inline-flex;
}

.workbench-detail-header .detail-toggle-expand {
    display: none;
}

.workbench-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-fill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.workbench-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.workbench-detail .form-item {
    margin-bottom: 8px;
}

.workbench-detail .form-label {
    margin-bottom: 4px;
    font-size: 12px;
}

.workbench-detail .form-input,
.workbench-detail .form-select {
    padding: 6px 10px;
    font-size: 12px;
}

.workbench-detail .form-row {
    margin-bottom: 8px;
    gap: 8px;
}

.workbench-detail .wb-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.workbench-detail .wb-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workbench-attach-list .attach-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 11px;
}

.workbench-attach-list .attach-item:last-child {
    border-bottom: none;
}

.workbench-attach-list .attach-item .btn {
    padding: 2px 6px;
    font-size: 11px;
}

.workbench-attach-upload {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

.workbench-attach-upload .btn {
    padding: 4px 10px;
    font-size: 11px;
}

.node-detail-lock {
    padding: 6px 8px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    font-size: 11px;
    color: #ad6800;
    margin-top: 8px;
}

.workbench-task-attach {
    margin-top: 12px;
}

.workbench-task-attach .card {
    margin-bottom: 0;
}

.workbench-collapse summary {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-fill);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.workbench-collapse summary::-webkit-details-marker {
    display: none;
}

.workbench-collapse summary::after {
    content: '▼';
    font-size: 10px;
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.workbench-collapse[open] summary::after {
    transform: rotate(180deg);
}

.workbench-collapse .collapse-body {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--bg-card);
}

.workbench-collapse .collapse-body .output-table th,
.workbench-collapse .collapse-body .output-table td {
    padding: 6px 8px;
    font-size: 12px;
}

/* ==================== Modal弹窗 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

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

.modal,
.modal-content {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    width: 100%;
    min-width: 320px;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 新建需求等需要更宽内容的弹窗 */
.modal.modal--wide,
.modal-content.modal--wide {
    max-width: 1120px;
    width: 92%;
    max-height: 90vh;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #fff;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.modal-type-approve .modal-header { border-top: 3px solid #52c41a; }
.modal-type-approve .modal-title-icon { background: #f6ffed; color: #52c41a; }

.modal-type-reject .modal-header { border-top: 3px solid #ff4d4f; }
.modal-type-reject .modal-title-icon { background: #fff2f0; color: #ff4d4f; }

.modal-type-import .modal-header { border-top: 3px solid #1890ff; }
.modal-type-import .modal-title-icon { background: #e6f7ff; color: #1890ff; }

.modal-type-export .modal-header { border-top: 3px solid #13c2c2; }
.modal-type-export .modal-title-icon { background: #e6fffb; color: #13c2c2; }

.modal-type-merge .modal-header { border-top: 3px solid #722ed1; }
.modal-type-merge .modal-title-icon { background: #f9f0ff; color: #722ed1; }

.modal-close {
    cursor: pointer;
    font-size: 20px;
    color: rgba(0,0,0,0.45);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: rgba(0,0,0,0.85);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 60px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #fafafa;
}

/* 弹窗内表单项间距 */
.modal-body .form-item {
    margin-bottom: 16px;
}
.modal-body .form-item:last-child {
    margin-bottom: 0;
}

/* ========== 弹窗注入页样式（必读） ==========
 * 凡在 edit-modal / list-view-modal 中通过 openModal(url) 动态加载的页面，
 * 只注入 .content-wrapper 内的 DOM 节点，不会注入该页的 <style>。
 * 因此所有影响布局的样式必须在本文件(system.css)中定义，否则弹窗内会
 * 出现布局错乱（如一行一字段、表格错位等）。新增弹窗表单时请同步在此添加对应 class 的样式。
 * ========== */
/* 新建需求表单 */
.demand-create-form .card-header { padding: 20px 28px 16px; border-bottom: 1px solid #e8e8e8; }
.demand-create-form .card-title { font-size: 16px; font-weight: 600; margin: 0; }
.demand-create-form .card-body { padding: 24px 28px 28px; }
.demand-create-form .page-description { font-size: 13px; color: #595959; line-height: 1.6; margin-bottom: 24px; padding: 12px 16px; background: #fafafa; border-radius: 6px; border-left: 3px solid #1890ff; }
.demand-create-form .form-section { margin-bottom: 28px; }
.demand-create-form .form-section:last-of-type { margin-bottom: 0; }
.demand-create-form .section-title { font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); margin: 0 0 16px 0; padding-bottom: 10px; border-bottom: 1px solid #e8e8e8; }
.demand-create-form .form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.demand-create-form .form-item.full-width { grid-column: 1 / -1; }
.demand-create-form .form-item.span-2 { grid-column: span 2; }
.demand-create-form .form-item .form-label { display: block; margin-bottom: 6px; font-size: 13px; color: rgba(0,0,0,0.85); }
.demand-create-form .form-item .form-label.required::before { content: '*'; color: #ff4d4f; margin-right: 4px; }
.demand-create-form .form-item .form-label.hint { display: inline; margin-left: 6px; font-weight: normal; color: #8c8c8c; font-size: 12px; }
.demand-create-form .form-item .form-input,
.demand-create-form .form-item .form-select,
.demand-create-form .form-item .form-textarea { width: 100%; padding: 8px 12px; font-size: 13px; border-radius: 4px; border: 1px solid #d9d9d9; box-sizing: border-box; }
.demand-create-form .form-item textarea.form-input { min-height: 72px; resize: vertical; }
.demand-create-form .table-wrapper { overflow-x: auto; margin-top: 12px; border: 1px solid #e8e8e8; border-radius: 6px; background: #fff; }
.demand-create-form .table-wrapper table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
.demand-create-form .table-wrapper th { padding: 12px 14px; text-align: left; font-size: 13px; font-weight: 600; color: rgba(0,0,0,0.85); background: #fafafa; border-bottom: 1px solid #e8e8e8; }
.demand-create-form .table-wrapper td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.demand-create-form .table-wrapper td .form-input { width: 100%; min-width: 0; padding: 7px 10px; font-size: 13px; border: 1px solid #d9d9d9; border-radius: 4px; box-sizing: border-box; }
.demand-create-form .table-wrapper tbody tr:hover td { background: #fafafa; }
.demand-create-form .table-wrapper tbody tr:last-child td { border-bottom: none; }
.demand-create-form .btn-add-line { margin-top: 14px; }
.demand-create-form .form-actions { padding: 16px 28px !important; border-top: 1px solid #e8e8e8; background: #fafafa; }

/* 新建采购计划表单（弹窗注入，样式须在本文件定义，见上方说明） */
.plan-create-form .card-header { padding: 20px 28px 16px; border-bottom: 1px solid #e8e8e8; }
.plan-create-form .card-title { font-size: 16px; font-weight: 600; margin: 0; }
.plan-create-form .card-body { padding: 24px 28px 28px; }
.plan-create-form .page-description { font-size: 13px; color: #595959; line-height: 1.6; margin-bottom: 24px; padding: 12px 16px; background: #fafafa; border-radius: 6px; border-left: 3px solid #1890ff; }
.plan-create-form .form-section { margin-bottom: 28px; }
.plan-create-form .form-section:last-of-type { margin-bottom: 0; }
.plan-create-form .section-title { font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); margin: 0 0 16px 0; padding-bottom: 10px; border-bottom: 1px solid #e8e8e8; }
.plan-create-form .form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 20px; }
.plan-create-form .form-item.full-width { grid-column: 1 / -1; }
.plan-create-form .form-item.span-2 { grid-column: span 2; }
.plan-create-form .form-item .form-label { display: block; margin-bottom: 6px; font-size: 13px; color: rgba(0,0,0,0.85); }
.plan-create-form .form-item .form-label.required::before { content: '*'; color: #ff4d4f; margin-right: 4px; }
.plan-create-form .form-item .form-label.hint { display: inline; margin-left: 6px; font-weight: normal; color: #8c8c8c; font-size: 12px; }
.plan-create-form .form-item .form-input,
.plan-create-form .form-item .form-select,
.plan-create-form .form-item .form-textarea { width: 100%; padding: 8px 12px; font-size: 13px; border-radius: 4px; border: 1px solid #d9d9d9; box-sizing: border-box; }
.plan-create-form .form-item textarea.form-input { min-height: 72px; resize: vertical; }
.plan-create-form .table-wrapper { overflow-x: auto; margin-top: 12px; border: 1px solid #e8e8e8; border-radius: 6px; background: #fff; }
.plan-create-form .table-wrapper table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
.plan-create-form .table-wrapper th { padding: 12px 14px; text-align: left; font-size: 13px; font-weight: 600; color: rgba(0,0,0,0.85); background: #fafafa; border-bottom: 1px solid #e8e8e8; }
.plan-create-form .table-wrapper td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.plan-create-form .table-wrapper td .form-input { width: 100%; min-width: 0; padding: 7px 10px; font-size: 13px; border: 1px solid #d9d9d9; border-radius: 4px; box-sizing: border-box; }
.plan-create-form .table-wrapper tbody tr:hover td { background: #fafafa; }
.plan-create-form .table-wrapper tbody tr:last-child td { border-bottom: none; }
.plan-create-form .btn-add-line { margin-top: 14px; }
.plan-create-form .form-actions { padding: 16px 28px !important; border-top: 1px solid #e8e8e8; background: #fafafa; }

/* 弹窗内文件上传区域（隐藏原生 file 样式，用自定义区域） */
.modal-body .file-upload-zone {
    position: relative;
    display: block;
    width: 100%;
    padding: 28px 24px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #fafafa;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.modal-body .file-upload-zone:hover {
    border-color: #1890ff;
    background: #e6f7ff;
}
.modal-body .file-upload-zone input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.modal-body .file-upload-zone .file-upload-text {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}
.modal-body .file-upload-zone .file-upload-hint {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}
.modal-body .file-upload-zone .file-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #1890ff;
    word-break: break-all;
}

.modal-desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.link-download {
    color: var(--primary-color, #1890ff);
    text-decoration: none;
}

.link-download:hover {
    text-decoration: underline;
}

.attach-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary);
}

.attach-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.attach-list li:last-child {
    border-bottom: none;
}

.attach-list-empty {
    color: var(--text-tertiary);
    font-style: normal;
}

/* ==================== 分页组件 ==================== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    color: var(--text-tertiary);
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
    background: #f0f8ff;
}

.page-btn.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.25;
}

.empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* ==================== 加载状态 ==================== */
.loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.loading-text {
    margin-left: 16px;
    color: rgba(0,0,0,0.45);
}

/* ==================== 滚动条美化 ==================== */
.app-sidebar::-webkit-scrollbar,
.app-main::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb,
.app-main::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 3px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover,
.app-main::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.28);
}

.app-sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.15);
}

.app-main::-webkit-scrollbar-track {
    background: var(--bg-page);
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.ml-8 { margin-left: 8px; }
.ml-16 { margin-left: 16px; }
.mr-8 { margin-right: 8px; }
.mr-16 { margin-right: 16px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }

/* 链接 */
.link {
    color: #1890ff;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s;
}

.link:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 分割线 */
.divider {
    height: 1px;
    background: #f0f0f0;
    margin: 16px 0;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #f5f5f5;
    color: rgba(0,0,0,0.65);
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag.blue {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.tag.green {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.tag.orange {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.tag.red {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .app-sidebar {
        width: 64px;
    }

    .menu-text,
    .menu-arrow,
    .submenu:not(.open) {
        display: none;
    }
    
    .submenu.open {
        display: block !important;
    }

    .menu-item,
    .menu-item-parent {
        justify-content: center;
        padding: 12px;
        margin: 0 8px;
    }

    .menu-icon {
        margin-right: 0;
    }

    .stats-grid,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item .form-input,
    .filter-item .form-select {
        min-width: 0;
    }

    .action-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

/* ==================== 批量操作按钮样式 ==================== */
.batch-action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.batch-action-btn {
    opacity: 0.4;
    pointer-events: none;
    transition: all 0.3s;
}

.batch-action-btn.enabled {
    opacity: 1;
    pointer-events: auto;
}

.selection-count {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.selection-count.hidden {
    display: none;
}

/* ==================== 单行操作按钮 ==================== */
.row-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

tbody tr:hover .row-actions {
    opacity: 1;
}

.row-action-more {
    position: relative;
    display: inline-block;
}

.row-action-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 120px;
    z-index: 100;
}

.row-action-dropdown.show {
    display: block;
}

.row-action-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: rgba(0,0,0,0.85);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.row-action-dropdown-item:hover {
    background: #f5f5f5;
}

/* ==================== 制造业特有组件样式 ==================== */

/* 批次选择器 */
.batch-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-input {
    flex: 1;
    min-width: 200px;
}

.batch-select-btn {
    flex-shrink: 0;
}

.batch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.batch-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0f2f5;
    border-radius: 3px;
    font-size: 12px;
}

.batch-tag-remove {
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.batch-tag-remove:hover {
    color: #ff4d4f;
}

/* SN号录入组件 */
.sn-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sn-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sn-scan-btn {
    flex-shrink: 0;
}

.sn-list {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.sn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.sn-item:last-child {
    border-bottom: none;
}

.sn-item-remove {
    cursor: pointer;
    color: #ff4d4f;
}

.sn-item-remove:hover {
    color: #ff4d4f;
    opacity: 0.8;
}

/* 齐套分析展示组件 */
.kitting-analysis {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.kitting-header {
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kitting-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.kitting-status.ok {
    color: #52c41a;
}

.kitting-status.warning {
    color: #faad14;
}

.kitting-status.error {
    color: #ff4d4f;
}

.kitting-body {
    padding: 0;
}

.kitting-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.kitting-item:last-child {
    border-bottom: none;
}

.kitting-item-header {
    background: #fafafa;
    font-weight: 600;
    color: rgba(0,0,0,0.65);
}

.kitting-material {
    font-weight: 500;
}

.kitting-demand {
    color: rgba(0,0,0,0.65);
}

.kitting-stock {
    font-weight: 500;
}

.kitting-stock.sufficient {
    color: #52c41a;
}

.kitting-stock.shortage {
    color: #ff4d4f;
}

.kitting-status-text {
    font-weight: 500;
}

.kitting-status-text.sufficient {
    color: #52c41a;
}

.kitting-status-text.shortage {
    color: #ff4d4f;
}

/* 工序进度条组件 */
.process-progress {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
}

.process-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.process-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #f0f0f0;
    color: #999;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.process-step.completed .process-step-icon {
    background: #52c41a;
    color: white;
}

.process-step.current .process-step-icon {
    background: #1890ff;
    color: white;
    animation: pulse 2s infinite;
}

.process-step.pending .process-step-icon {
    background: #f0f0f0;
    color: #999;
}

.process-step-label {
    font-size: 12px;
    color: rgba(0,0,0,0.65);
    text-align: center;
}

.process-step.completed .process-step-label,
.process-step.current .process-step-label {
    color: rgba(0,0,0,0.85);
    font-weight: 500;
}

.process-line {
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #f0f0f0;
    z-index: 1;
}

.process-step.completed .process-line {
    background: #52c41a;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(24,144,255,0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(24,144,255,0);
    }
}

/* 库存锁定标识组件 */
stock-lock-info {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 12px 16px;
}

.stock-lock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.stock-lock-title {
    font-weight: 600;
    font-size: 14px;
}

.stock-lock-total {
    font-size: 18px;
    font-weight: 600;
    color: rgba(0,0,0,0.85);
}

.stock-lock-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-lock-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 13px;
}

.stock-lock-label {
    color: rgba(0,0,0,0.65);
    min-width: 60px;
}

.stock-lock-value {
    font-weight: 500;
    color: rgba(0,0,0,0.85);
}

.stock-lock-value.available {
    color: #52c41a;
}

.stock-lock-value.locked {
    color: #faad14;
}

.stock-lock-value.frozen {
    color: #ff4d4f;
}

.stock-lock-reason {
    font-size: 12px;
    color: rgba(0,0,0,0.45);
    margin-left: auto;
}

/* Toast提示 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 18px;
}

.toast-success {
    border-left: 3px solid #52c41a;
}

.toast-success .toast-icon {
    color: #52c41a;
}

.toast-error {
    border-left: 3px solid #ff4d4f;
}

.toast-error .toast-icon {
    color: #ff4d4f;
}

.toast-warning {
    border-left: 3px solid #faad14;
}

.toast-warning .toast-icon {
    color: #faad14;
}

.toast-info {
    border-left: 3px solid #1890ff;
}

.toast-info .toast-icon {
    color: #1890ff;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: rgba(0,0,0,0.85);
}

/* 筛选区展开/收起功能 */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #1890ff;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    transition: color 0.2s;
}

.filter-toggle:hover {
    color: #40a9ff;
}

.filter-toggle-icon {
    transition: transform 0.3s;
}

.filter-toggle.expanded .filter-toggle-icon {
    transform: rotate(180deg);
}

.filter-advanced {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.filter-advanced.show {
    display: block;
}

/* ==================== 打印样式 ==================== */
@media print {
    .app-header,
    .app-sidebar,
    .action-bar,
    .filter-bar,
    .pagination,
    .btn {
        display: none;
    }

    .app-main {
        overflow: visible;
    }

    .content-wrapper {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
