/**
 * index.css — 物料制作主工作区样式（参考设计 V2-1）
 * 布局：userbar 32px / projectbar 80px / tabbar 44px / toolbar 48px / 物料表格
 */

/* ===========================================================
   应用容器 — 纵向弹性布局（固定高度 100vh）
   =========================================================== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ===========================================================
   项目信息栏 (48px，单行)
   =========================================================== */
.projectbar {
    height: 48px; min-height: 48px;
    display: flex; align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    background: var(--surface);
    flex-shrink: 0;
}
.projectbar-info { flex: 1; min-width: 0; overflow: hidden; }
.projectbar-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--fg);
    flex-wrap: nowrap; overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis;
}
.projectbar-row .label { color: var(--muted); flex-shrink: 0; }
.projectbar-row .sep { color: var(--border); user-select: none; flex-shrink: 0; }

.projectbar-search {
    flex: 0 0 260px;
    position: relative;
}
.projectbar-search input {
    width: 100%; height: 32px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px 0 32px;
    font-size: 13px;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s;
}
.projectbar-search input:focus { border-color: var(--accent); }
.projectbar-search .icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 13px;
    pointer-events: none;
}
.projectbar-search .dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius); margin-top: 4px;
    display: none; z-index: 50; max-height: 240px; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.projectbar-search .dropdown.open { display: block; }
.projectbar-search .dropdown .opt {
    padding: 8px 12px; cursor: pointer; font-size: 13px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.projectbar-search .dropdown .opt:last-child { border-bottom: 0; }
.projectbar-search .dropdown .opt:hover { background: var(--surface-2); }
.projectbar-search .dropdown .opt-name { color: var(--fg); }
.projectbar-search .dropdown .opt-meta { color: var(--muted); font-size: 11px; }
.projectbar-search .dropdown .no-result { padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.projectbar-search .dropdown .opt-name mark,
.projectbar-search .dropdown .opt-meta mark {
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 2px;
    padding: 0 1px;
}
.projectbar-search .dropdown .opt-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 3px;
    background: var(--accent-glow);
    color: var(--accent);
    vertical-align: middle;
}

.projectbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ===========================================================
   按钮（参考设计）
   =========================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; height: 32px; padding: 0 16px;
    border: none; border-radius: var(--radius);
    cursor: pointer; font-size: 13px; font-weight: 500;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
    white-space: nowrap;
    font-family: var(--font);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }
.btn-secondary { background: var(--border); color: var(--fg); }
.btn-secondary:hover { background: #444; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-text { background: none; color: var(--accent); height: auto; padding: 0; font-size: 12px; }
.btn-text:hover { text-decoration: underline; }
.btn-muted { background: none; color: var(--muted); height: auto; padding: 0; font-size: 12px; }
.btn-muted:hover { color: var(--fg); text-decoration: none; }
.btn:disabled { background: var(--disabled); color: var(--muted); cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ===========================================================
   标签栏 (44px)
   =========================================================== */
.tabbar {
    height: 44px; min-height: 44px;
    display: flex; align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    gap: 0;
    flex-shrink: 0;
}
.tab {
    height: 100%; padding: 0 20px;
    display: flex; align-items: center;
    font-size: 13px; cursor: pointer;
    color: var(--muted); position: relative;
    transition: color 0.15s;
    user-select: none;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); }
.tab.active::after {
    content: ''; position: absolute; bottom: 0; left: 12px; right: 12px;
    height: 2px; background: var(--accent); border-radius: 1px;
}
.tab.disabled { color: var(--disabled); cursor: not-allowed; }
.tab.disabled:hover { color: var(--disabled); }
.tab .lock { font-size: 10px; margin-left: 4px; }

/* ===========================================================
   主工作区
   =========================================================== */
.workspace {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* ===== 工具栏 (48px) ===== */
.toolbar {
    height: 48px; min-height: 48px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar .version-select {
    background: var(--surface-3); color: var(--fg);
    border: 1px solid var(--border); border-radius: var(--radius);
    height: 28px; padding: 0 8px; font-size: 12px;
    outline: none; cursor: pointer;
    font-family: var(--font);
}
.toolbar .version-select:focus { border-color: var(--accent); }

/* ===== 物料表格 ===== */
.table-wrap {
    flex: 1;
    overflow: auto;
    position: relative;
    min-height: 0; /* 允许 flex 子元素收缩，否则无法滚动 */
}
.table-wrap table {
    width: 100%;
    min-width: 2600px;  /* 保证所有列可见，横向滚动 */
    border-collapse: collapse;
    table-layout: fixed; /* 固定列宽，防止超长内容撑开列 */
    font-size: 13px;
}
.table-wrap thead {
    position: sticky; top: 0; z-index: 10;
}
.table-wrap th {
    background: #151515;
    padding: 0 8px; height: 32px;
    text-align: left; font-weight: 500;
    color: var(--muted); font-size: 12px;
    border-bottom: 1px solid var(--border);
    user-select: none; white-space: nowrap;
    position: relative;
    overflow: hidden; text-overflow: ellipsis;
}
.table-wrap td {
    padding: 0 6px; height: 34px;
    border-bottom: 1px solid rgba(51,51,51,0.4);
    color: var(--fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table-wrap tr { transition: background 0.1s; }
.table-wrap tbody tr:hover { background: var(--surface-2); }
.table-wrap tr.selected td { border-left: 3px solid var(--accent); }

.table-wrap th:nth-child(1), .table-wrap td:nth-child(1) { width: 36px; min-width: 36px; text-align: center; }
.table-wrap th:last-child, .table-wrap td:last-child { width: 116px; min-width: 116px; text-align: center; }

/* 各列宽度（参考设计） */
.table-wrap th, .table-wrap td { min-width: 76px; }
.table-wrap th[data-col="material-id"], .table-wrap td[data-col="material-id"] { width: 90px; }
.table-wrap th[data-col="material-name"], .table-wrap td[data-col="material-name"] { width: 110px; }
.table-wrap th[data-col="material-category"], .table-wrap td[data-col="material-category"] { width: 100px; }
.table-wrap th[data-col="brand"], .table-wrap td[data-col="brand"] { width: 100px; }
.table-wrap th[data-col="product-series"], .table-wrap td[data-col="product-series"] { width: 110px; }
.table-wrap th[data-col="color"], .table-wrap td[data-col="color"] { width: 80px; }
.table-wrap th[data-col="size"], .table-wrap td[data-col="size"] { width: 110px; }
.table-wrap th[data-col="surface-treatment"], .table-wrap td[data-col="surface-treatment"] { width: 90px; }
.table-wrap th[data-col="use-area"], .table-wrap td[data-col="use-area"] { width: 110px; }
.table-wrap th[data-col="location"], .table-wrap td[data-col="location"] { width: 110px; }
.table-wrap th[data-col="product-model"], .table-wrap td[data-col="product-model"] { width: 100px; }
.table-wrap th[data-col="remarks"], .table-wrap td[data-col="remarks"] { width: 110px; }
.table-wrap th[data-col="fire-rating"], .table-wrap td[data-col="fire-rating"] { width: 80px; }
.table-wrap th[data-col="tech-params"], .table-wrap td[data-col="tech-params"] { width: 140px; }
.table-wrap th[data-col="tech-spec"], .table-wrap td[data-col="tech-spec"] { width: 140px; }
.table-wrap th[data-col="origin"], .table-wrap td[data-col="origin"] { width: 90px; }
.table-wrap th[data-col="supplier"], .table-wrap td[data-col="supplier"] { width: 120px; }
.table-wrap th[data-col="contact"], .table-wrap td[data-col="contact"] { width: 120px; }
.table-wrap th[data-col="material-image"], .table-wrap td[data-col="material-image"] { width: 80px; }
.table-wrap th[data-col="history-projects"], .table-wrap td[data-col="history-projects"] { width: 130px; }
.table-wrap th[data-col="approved-brands"], .table-wrap td[data-col="approved-brands"] { width: 120px; }
.table-wrap th[data-col="custom1"], .table-wrap td[data-col="custom1"] { width: 100px; }
.table-wrap th[data-col="custom2"], .table-wrap td[data-col="custom2"] { width: 100px; }
.table-wrap th[data-col="marker-color"], .table-wrap td[data-col="marker-color"] { width: 110px; }

/* 隐藏列辅助 */
.col-hide { display: none !important; }

/* 单元格类型 */
.cell-input {
    background: var(--surface-2); border: 1px solid transparent;
    border-radius: var(--radius-sm); padding: 0 6px; height: 28px;
    width: 100%; color: var(--fg); font-size: 13px;
    outline: none; transition: border-color 0.15s;
    font-family: var(--font);
}
.cell-input:focus { border-color: var(--accent); }
.cell-select {
    background: var(--surface-2); border: 1px solid transparent;
    border-radius: var(--radius-sm); padding: 0 4px; height: 28px;
    width: 100%; color: var(--fg); font-size: 13px;
    outline: none; cursor: pointer; transition: border-color 0.15s;
    font-family: var(--font);
}
.cell-select:focus { border-color: var(--accent); }
/* 只读单元格：固定单行显示，超长省略，鼠标悬停显示完整内容 */
.cell-readonly {
    color: var(--muted);
    font-size: 13px;
    padding: 0 6px;
    display: table-cell;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    vertical-align: middle;
}
.cell-img {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--surface-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer;
}
.cell-img:hover { border: 1px solid var(--accent); }
.cell-img img { width: 34px; height: 34px; object-fit: cover; border-radius: 3px; }

.table-wrap .actions { display: flex; gap: 2px; justify-content: center; }
.table-wrap .actions button {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 13px; padding: 3px 5px;
    border-radius: 4px; white-space: nowrap;
}
.table-wrap .actions button:hover { background: var(--surface-3); color: var(--fg); }
.table-wrap .actions button.danger:hover { color: var(--danger); }
.table-wrap .actions button.edit:hover { color: var(--accent); }

/* ===== 复选框 ===== */
.chk {
    width: 16px; height: 16px; border-radius: 3px;
    border: 1px solid var(--disabled);
    background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    font-size: 11px; color: transparent;
    appearance: none; -webkit-appearance: none;
}
.chk:checked {
    background: var(--accent); border-color: var(--accent);
    color: var(--on-accent);
}
.chk:checked::after { content: '✓'; }
.chk:hover { border-color: var(--muted); }

/* ===========================================================
   弹窗表单
   =========================================================== */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 500;
    margin-bottom: 4px; color: var(--fg);
}
.form-group .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.form-input, .form-select, .form-textarea {
    width: 100%; height: 32px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0 10px;
    font-size: 13px; color: var(--fg); outline: none;
    transition: border-color 0.15s;
    font-family: var(--font);
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ===========================================================
   输出格式网格
   =========================================================== */
.format-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.format-item {
    height: 60px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    transition: border-color 0.15s; font-size: 12px;
    color: var(--fg-secondary);
}
.format-item:hover { border-color: var(--accent); }
.format-item .icon { font-size: 20px; margin-bottom: 2px; }
.format-item.selected { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }

/* ===========================================================
   版本列表
   =========================================================== */
.version-list { display: flex; flex-direction: column; }
.version-list .v-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.version-list .v-item:last-child { border-bottom: 0; }
.version-list .v-meta { flex: 1; }
.version-list .v-meta .ver { font-weight: 600; font-size: 14px; color: var(--fg); }
.version-list .v-meta .meta { font-size: 12px; color: var(--muted); }
.version-list .v-tag {
    font-size: 10px; padding: 0 6px; height: 20px; line-height: 20px;
    border-radius: 3px;
}
.version-list .v-tag.current { background: var(--accent-glow); color: var(--accent); }

/* ===========================================================
   切换账号用户卡片
   =========================================================== */
.user-cards { display: flex; flex-direction: column; gap: 8px; }
.user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    transition: border-color 0.15s;
}
.user-card:hover { border-color: var(--accent); }
.user-card-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--on-accent);
}
.user-card-info { flex: 1; }
.user-card-info .name { font-size: 14px; font-weight: 500; color: var(--fg); }
.user-card-info .role { font-size: 12px; color: var(--muted); }

/* ===========================================================
   导出 — 输出路径提示
   =========================================================== */
.export-save-location .hint { color: var(--muted); }

/* 导入基础数据等按钮已用 .btn-muted 灰色样式 */

/* ===========================================================
   多选下拉组件（面板勾选 + 自定义新增）
   =========================================================== */
.cell-select .multi-trigger {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; width: 100%; height: 28px;
    background: var(--surface-2); border: 1px solid transparent;
    border-radius: var(--radius-sm); padding: 0 8px;
    color: var(--fg); font-size: 13px;
    cursor: pointer; transition: border-color 0.15s;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-select .multi-trigger::after {
    content: '▾'; color: var(--muted); font-size: 10px; flex-shrink: 0;
}
.cell-select .multi-trigger:hover,
.cell-select .multi-trigger.open { border-color: var(--accent); }

.multi-select-panel {
    position: fixed; z-index: 700;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    padding: 6px;
    font-size: 13px; color: var(--fg);
}
.multi-select-panel .msp-list {
    max-height: 220px; overflow-y: auto;
}
.multi-select-panel .msp-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; cursor: pointer;
    border-radius: 4px;
}
.multi-select-panel .msp-item:hover { background: var(--surface-2); }
.multi-select-panel .msp-item input[type="checkbox"] {
    width: 15px; height: 15px; flex-shrink: 0;
    cursor: pointer; accent-color: var(--accent);
}
.multi-select-panel .msp-item span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.multi-select-panel .msp-empty {
    padding: 12px; color: var(--muted); font-size: 12px; text-align: center;
}
.multi-select-panel .msp-add {
    display: flex; gap: 6px; margin-top: 6px; padding-top: 6px;
    border-top: 1px solid var(--border);
}
.multi-select-panel .msp-input {
    flex: 1; min-width: 0;
    height: 28px; padding: 0 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--fg); font-size: 12px;
    outline: none; font-family: var(--font);
}
.multi-select-panel .msp-input:focus { border-color: var(--accent); }
.multi-select-panel .msp-add-btn {
    height: 28px; padding: 0 10px;
    background: var(--accent); color: var(--on-accent); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 12px; flex-shrink: 0;
}
.multi-select-panel .msp-add-btn:hover { background: var(--accent-hover); }

/* ===========================================================
   标记色列（圆形色块 + 色名，点击弹出选色面板）
   =========================================================== */
.marker-swatch {
    display: inline-flex; align-items: center; gap: 6px;
    width: 100%; height: 28px; cursor: pointer;
    padding: 0 4px;
}
.marker-swatch .marker-dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.28); flex-shrink: 0;
}
.marker-swatch .marker-name {
    font-size: 12px; color: var(--fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.marker-swatch .marker-none { color: var(--muted); font-size: 12px; }

.marker-color-panel {
    position: fixed; z-index: 700;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    padding: 10px;
    font-size: 13px; color: var(--fg);
}
.marker-color-panel .mcp-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.marker-color-panel .mcp-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.marker-color-panel .mcp-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 2px; border-radius: 6px; cursor: pointer;
    border: 1px solid transparent;
}
.marker-color-panel .mcp-item:hover { background: var(--surface-2); }
.marker-color-panel .mcp-item.active { border-color: var(--accent); }
.marker-color-panel .mcp-dot {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
.marker-color-panel .mcp-name { font-size: 10px; color: var(--muted); }
.marker-color-panel .mcp-clear {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
    text-align: center; color: var(--danger); cursor: pointer; font-size: 12px;
}
.marker-color-panel .mcp-clear:hover { text-decoration: underline; }

/* ===========================================================
   标记色说明下拉面板（需求③）
   =========================================================== */
.marker-notes-panel {
    position: fixed; z-index: 700;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    padding: 10px 12px;
    font-size: 13px; color: var(--fg);
}
.marker-notes-panel .mnp-title {
    font-size: 13px; font-weight: 600; color: var(--fg);
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.marker-notes-panel .mnp-close {
    cursor: pointer; color: var(--muted); font-size: 13px; padding: 0 4px;
}
.marker-notes-panel .mnp-close:hover { color: var(--fg); }
.marker-notes-panel .mnp-sub {
    font-size: 11px; color: var(--muted); margin-bottom: 8px;
}
.marker-notes-panel .mnp-list {
    max-height: 320px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
}
.marker-notes-panel .mnp-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 6px; border-radius: 6px;
}
.marker-notes-panel .mnp-item:hover { background: var(--surface-2); }
.marker-notes-panel .mnp-dot {
    width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2); flex-shrink: 0;
}
.marker-notes-panel .mnp-name {
    width: 72px; flex-shrink: 0; font-size: 12px; color: var(--fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.marker-notes-panel .mnp-note {
    flex: 1; min-width: 0; font-size: 12px; color: var(--fg-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.marker-notes-panel .mnp-note.empty { color: var(--muted); }
.marker-notes-panel .mnp-note-input {
    flex: 1; min-width: 0; height: 26px; padding: 0 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--fg); font-size: 12px;
    outline: none; font-family: var(--font);
}
.marker-notes-panel .mnp-note-input:focus { border-color: var(--accent); }
.marker-notes-panel .mnp-footer {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end;
}

/* 标记色行背景：整行浅色底 → 单元格背景透明、前景深色保证可读 */
.table-wrap tr.row-marked td { background: transparent; color: #1f1f1f; }
.table-wrap tr.row-marked td.cell-readonly { color: #1f1f1f; }
.table-wrap tr.row-marked td .cell-input,
.table-wrap tr.row-marked td select.cell-select,
.table-wrap tr.row-marked td .multi-trigger { background: transparent; color: #1f1f1f; }
.table-wrap tr.row-marked td .cell-input::placeholder { color: rgba(0, 0, 0, 0.35); }

/* ===========================================================
   单元格悬停 Tooltip
   =========================================================== */
.cell-tooltip {
    position: fixed;
    z-index: 600;
    max-width: 380px;
    max-height: 320px;
    overflow: auto;
    padding: 10px 14px;
    background: #262626;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: #e8e8e8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-word;
    display: none;
}
.cell-tooltip.visible { display: block; }

/* ===========================================================
   新增物料弹窗 — 自动回填字段网格
   =========================================================== */
.autofill-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
}
.autofill-grid .form-group { margin-bottom: 0; }
.autofill-grid .form-group.full { grid-column: 1 / -1; }
.autofill-grid label { font-size: 12px; color: var(--muted); }
.autofill-grid input,
.autofill-grid textarea {
    background: var(--surface-2);
    font-size: 12px;
}

/* ===========================================================
   新增/编辑物料弹窗 — 材料图片上传区
   =========================================================== */
.material-image-upload {
    display: flex; align-items: center; gap: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
}
.material-image-upload .miu-preview {
    flex: 0 0 120px;
    width: 120px; height: 96px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    border: 1px dashed var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}
.material-image-upload .miu-preview img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 4px;
}
.material-image-upload .miu-preview .miu-placeholder {
    color: var(--muted); font-size: 12px;
    padding: 8px; text-align: center;
}
.material-image-upload .miu-actions {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.material-image-upload .miu-status {
    font-size: 12px; color: var(--accent);
}
.material-image-upload .miu-status.ok { color: var(--success); }
.material-image-upload .miu-status.muted { color: var(--muted); }
.material-image-upload .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   导入预览表格 + 导入记录表格（阶段二）
   =========================================================== */
.import-preview-table,
.import-records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.import-preview-table th,
.import-preview-table td,
.import-records-table th,
.import-records-table td {
    border: 1px solid var(--border);
    padding: 5px 8px;
    text-align: left;
    white-space: nowrap;
}
.import-preview-table th,
.import-records-table th {
    background: var(--surface-2);
    position: sticky;
    top: 0;
    z-index: 1;
}
.import-preview-table td {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.imp-status {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 18px;
}
.imp-st-ok { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.imp-st-warn { background: rgba(241, 196, 15, 0.18); color: #e0b50b; }
.imp-st-error { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.rec-err { color: var(--danger); font-weight: 600; }
.rec-detail-row td { background: var(--surface-2); }
.import-records-table td:first-child { white-space: nowrap; }
.import-records-table td:nth-child(2) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* 导入旧项目：预览勾选表格 */
.import-preview-table tr { cursor: pointer; }
.import-preview-table tr:hover { background: var(--surface-2); }
.import-preview-table tr.imp-row-selected { background: rgba(52, 152, 219, 0.08); }
.import-preview-table tr.imp-row-selected:hover { background: rgba(52, 152, 219, 0.13); }
.import-preview-table .imp-row-chk { cursor: pointer; }
.import-preview-table .imp-mark-readonly { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.import-preview-table .imp-mark-readonly .marker-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.28); flex-shrink: 0; display: inline-block;
}
.import-preview-table .imp-mark-readonly .marker-name { font-size: 12px; color: var(--fg); }
.import-preview-table .imp-mark-readonly .marker-none { color: var(--muted); font-size: 12px; }

/* 导入旧项目：完成弹窗 */
.imp-result-summary { font-size: 14px; margin-bottom: 10px; }
.imp-result-summary .ok { color: var(--success); font-weight: 600; }
.imp-result-summary .bad { color: var(--danger); font-weight: 600; }
.imp-result-detail { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
