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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

/* ===== 登录页面 ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(24, 144, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(24, 144, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(24, 144, 255, 0.05) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, -10px); }
}

.login-container {
    width: 440px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 60px 50px;
    position: relative;
    z-index: 1;
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #1890ff;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-primary:active {
    background: #096dd9;
}

.error-msg {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

/* ===== 主布局 ===== */
.main-layout {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    width: 100vw;
}

.sidebar {
    width: 220px;
    background: #001529;
    color: white;
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-logo {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-logo h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-menu li.active {
    background: #1890ff;
    color: white;
}


.sidebar-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar-btn.btn-pwd {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-btn.btn-pwd:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sidebar-btn.btn-logout {
    background: rgba(255, 77, 79, 0.8);
    color: white;
}

.sidebar-btn.btn-logout:hover {
    background: rgba(255, 77, 79, 1);
}

.content-wrapper {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}

.page-header {
    background: white;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* ===== 表格区域 ===== */
.table-container {
    background: white;
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    width: 100%;
}

.toolbar {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== 列设置下拉 ===== */
.column-toggle-wrapper {
    position: relative;
    margin-left: auto;
}

.column-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #1f1f2e;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    padding: 10px 14px;
    z-index: 100;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    max-height: 360px;
    overflow-y: auto;
}

.column-dropdown.show {
    display: block;
}

.column-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.column-dropdown label:hover {
    color: #fff;
}

.column-dropdown input[type="checkbox"] {
    accent-color: #4a90d9;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* 列设置分组：常显列 / 可开关列 */
.column-dropdown .column-group-title {
    font-size: 11px;
    color: #8c8c8c;
    padding: 6px 0 2px;
    border-bottom: 1px solid #3a3a4a;
    margin-bottom: 2px;
}

.column-dropdown .column-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    margin-bottom: 4px;
}

.column-dropdown input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.column-dropdown label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.65;
}

.column-dropdown label:has(input:disabled):hover {
    color: #ccc;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

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

.btn-blue:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.action-links {
    display: flex;
    gap: 12px;
}

.action-links a {
    font-size: 13px;
}

.action-links .danger {
    color: #ff4d4f;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.pagination-info {
    color: #666;
    font-size: 13px;
}

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

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

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

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

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal {
    background: white;
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

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

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 4px;
    margin-left: -4px;
    margin-right: -4px;
}

/* 基础字段值不合法标红 */
.form-row.field-invalid {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.form-row.field-invalid input,
.form-row.field-invalid select {
    color: #ff4d4f;
    font-weight: 600;
}

.form-label {
    width: 120px;
    text-align: right;
    padding-right: 12px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

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

.form-control {
    flex: 1;
    min-width: 0;
}

.form-control input,
.form-control select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-control input:focus,
.form-control select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.image-upload {
    width: 200px;
    height: 200px;
    border: 2px dashed #d9d9d9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
    background: #fafafa;
}

.image-upload:hover {
    border-color: #1890ff;
}

.image-upload img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.image-upload .placeholder {
    color: #999;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
}

/* 图片 hover 工具栏 */
.image-toolbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.25s;
}

.image-upload:hover .image-toolbar {
    opacity: 1;
}

.toolbar-icon {
    color: white;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.toolbar-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== 消息提示 ===== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.show {
    display: block;
}

.message.success {
    border-left: 4px solid #52c41a;
}

.message.error {
    border-left: 4px solid #ff4d4f;
}

.message.warning {
    border-left: 4px solid #faad14;
}

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

/* ===== 新增装备弹窗扩展样式 ===== */

/* 大尺寸弹窗（固定高度，表单区内部滚动） */
.modal-lg {
    width: 1150px;
    height: 88vh;
}

/* 表单分区 */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

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

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 3px solid #1890ff;
}

/* 单选按钮组 - 单行显示 */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.radio-group input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

/* 属性行 */
.attribute-row {
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    border-radius: 6px;
}

/* 属性名不属于当前类型的标红提示 */
.attribute-row.attr-invalid {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.attribute-row.attr-invalid .attr-autocomplete-input {
    color: #ff4d4f;
    font-weight: 600;
}

.attribute-row-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 属性行内的类型下拉：固定窄宽度，把空间让给属性名下拉 */
.attribute-row-inner .attr-type-select {
    width: 80px;
    flex-shrink: 0;
    padding: 0 4px;
}

.attribute-row-inner .attr-autocomplete {
    position: relative;
    min-width: 220px;
    flex: 1;
    width: auto;
}

.attr-autocomplete-input {
    width: 100%;
    height: 40px;
    padding: 0 30px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.attr-autocomplete-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.attr-autocomplete-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #bbb;
    pointer-events: none;
}

.attribute-row-inner .attr-value-input {
    width: 110px;
    flex-shrink: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

/* 属性行内的删除按钮不被挤压换行 */
.attribute-row-inner .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.attribute-row-inner .attr-value-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 小按钮 */
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    height: 32px;
}

/* 模糊搜索下拉列表 */
.attr-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    display: none;
    margin-top: 2px;
}

.attr-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}

.attr-autocomplete-item:hover,
.attr-autocomplete-item.active {
    background: #e6f7ff;
    color: #1890ff;
}

.attr-autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 价格大写显示 */
.price-uppercase {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.price-uppercase .uppercase-text {
    color: #e8a735;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-lg {
        width: 95%;
    }
    
    .attribute-row-inner {
        flex-wrap: wrap;
    }
    
    .attribute-row-inner .attr-autocomplete,
    .attribute-row-inner .attr-value-input {
        width: calc(50% - 6px);
    }
}

/* ===== 图片预览弹层 ===== */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
}

.image-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    color: white;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.preview-close:hover {
    opacity: 1;
}

/* 属性名文本输入框（用于回显不在下拉列表中的属性） */
.attr-name-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.attr-name-input:focus {
    border-color: #40a9ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* ========== 筛选栏样式 ========== */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(to right, #f8faff, #f0f7ff);
    border: 1px solid #d6e4ff;
    border-radius: 8px;
    margin-bottom: 16px;
}

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

.filter-item label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.filter-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    min-width: 0;
}

.filter-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
}

.filter-input.price-input {
    width: 100px;
}

.filter-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 140px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
}

.filter-separator {
    color: #999;
    font-size: 14px;
    margin: 0 4px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.filter-actions .btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-actions .btn-blue {
    background: #1890ff;
    color: white;
    border: 1px solid #1890ff;
}

.filter-actions .btn-blue:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

.filter-actions .btn-sm:not(.btn-blue) {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
}

.filter-actions .btn-sm:not(.btn-blue):hover {
    color: #1890ff;
    border-color: #1890ff;
}

/* 属性拖拽手柄 */
.attr-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 36px;
    margin-right: 8px;
    cursor: grab;
    color: #bbb;
    font-size: 14px;
    letter-spacing: -2px;
    user-select: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.attr-drag-handle:hover {
    color: #1890ff;
    background: #f0f5ff;
}

.attr-drag-handle:active {
    cursor: grabbing;
}

/* 拖拽状态样式 */
.attribute-row.dragging {
    opacity: 0.4;
    border: 2px dashed #1890ff;
    background: #f0f5ff;
}

.attribute-row.drag-over {
    border-top: 3px solid #1890ff;
    margin-top: -2px;
}

/* ==================== 统计信息栏 ==================== */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

.stats-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stats-label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.stats-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.stats-tag b {
    color: #1890ff;
    font-weight: 600;
}

/* ==================== 弹窗滚动穿透修复 ==================== */
.modal-overlay.show {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

/* ==================== 图片上传+AI按钮布局 ==================== */
.image-upload-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.image-upload-wrapper .image-upload {
    flex-shrink: 0;
}

.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    height: 36px;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}



/* ==================== 弹框内下拉框向上展开 ==================== */
.modal .form-control select {
    /* 当下拉框在弹框底部时，改为向上展开 */
    background-position: right 8px top 50%;
}

/* 弹框内所有select选项向上弹出 */
.modal-overlay .modal select {
    direction: ltr;
}

/* 弹框底部区域的下拉框特殊处理 */
.modal .form-section:last-of-type select,
.modal .modal-body > form > .form-section:last-child select {
    /* 使用原生select，通过CSS控制 */
}

/* 通用解决方案：弹框内的select使用fixed定位的自定义下拉 */
/* 简化方案：给弹框内的select添加向上弹出的class */
.modal select.dropup {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 4L2 8h8z'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
}

/* 弹框滚动时保持底部固定 */
.modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
    border-top: 1px solid #e8e8e8;
}

/* 弹框头部固定 */
.modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-bottom: 1px solid #e8e8e8;
}

/* 弹框内容区域可滚动 */
.modal-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* ==================== 禁用字段置灰样式 ==================== */
.form-control input:disabled,
.form-control select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e8e8e8;
    opacity: 1;
}

/* ==================== 操作列固定右侧 ==================== */
.data-table th:last-child,
.data-table td:last-child {
    position: sticky;
    right: 0;
    background: white;
    z-index: 1;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.06);
}

.data-table thead th:last-child {
    background: #fafafa;
    z-index: 2;
}

/* ==================== 表格内容单行省略 ==================== */
.data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 装备列表页（table-scroll-wrapper 仅装备页使用）：其它列内容上限收窄，让宽度给概述列 */
.table-scroll-wrapper .data-table td {
    max-width: 200px;
}

/* 装备概述列例外：不限宽，自动吸收表格剩余宽度 */
.table-scroll-wrapper .data-table th[data-col="summary"],
.table-scroll-wrapper .data-table td[data-col="summary"] {
    max-width: none;
}

/* ==================== 表格滚动容器（仅表格区域可滚动） ==================== */
.table-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* ==================== 新增商品弹框（原型改版） ==================== */
.modal-body-two-col {
    display: flex;
    overflow: hidden;
    padding: 24px;
    gap: 0;
    min-height: 0;
}

/* 右侧表单面板：所有字段改为两行式（标签在上、控件在下） */
.right-form-panel .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.right-form-panel .form-label {
    width: auto;
    text-align: left;
    padding-right: 0;
}

/* 价格：输入框与大写均固定宽度，大写同行显示 */
.price-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-control input {
    flex: none;
    width: 320px;
}

.price-control .price-uppercase {
    margin-top: 0;
    width: 260px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* AI识别按钮位于图片下方 */
.left-image-panel .btn-ai {
    margin-top: 12px;
}

/* 左侧图片面板 - 固定不滚动 */
.left-image-panel {
    width: 450px;
    flex-shrink: 0;
    padding-right: 24px;
    border-right: 2px dashed #d9d9d9;
    overflow: hidden;
}

/* 左侧面板中的图片上传区域适配 */
.left-image-panel .image-upload {
    width: 100%;
    max-width: 400px;
    height: 400px;
}

.left-image-panel .image-upload-wrapper {
    flex-direction: column;
    align-items: flex-start;
}

/* 左侧面板中的表单行 - label 改为顶部对齐 */
.left-image-panel .form-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.left-image-panel .form-label {
    width: auto;
    text-align: left;
    padding-right: 0;
}

.left-image-panel .form-control {
    width: 100%;
}

/* 右侧表单面板 - 可滚动（仅纵向；预留滚动条空间，避免遮挡输入框） */
.right-form-panel {
    flex: 1;
    min-width: 0;
    padding-left: 24px;
    padding-right: 12px;
    scrollbar-gutter: stable;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}
