/**
 * 商品管理系统 v2.0 - 完整样式文件
 * 提取自 product-manage-v2.html
 * 保留所有功能样式，确保无遗漏
 */

/* ==================== CSS 变量定义 ==================== */
:root {
    --primary-color: #667eea;
    --primary-hover: #5568d3;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #f5576c;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-disabled: #999999;
    --border-color: #e0e0e0;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-primary);
}

/* ==================== 侧边导航栏样式 ==================== */
.sidebar-nav {
    width: 220px;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 12px rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
}

.sidebar-nav.collapsed {
    width: 64px;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
}

.sidebar-header h5 {
    color: white;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-nav.collapsed .sidebar-header h5 .header-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-toggle-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.sidebar-nav.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-nav .nav-item {
    margin: 4px 8px;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link .nav-text {
    transition: opacity 0.2s ease, width 0.3s ease;
}

.sidebar-nav.collapsed .nav-link .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar-nav.collapsed .nav-item {
    margin: 4px 6px;
}

/* 子菜单样式 */
.nav-has-submenu .submenu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-submenu-item {
    margin: 2px 8px 2px 24px;
}

.nav-submenu-item a {
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.nav-submenu-item a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-submenu-item a.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.nav-submenu-item a i {
    font-size: 14px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.sidebar-nav.collapsed .nav-submenu {
    display: none;
}

.sidebar-nav.collapsed .submenu-arrow {
    display: none;
}

/* 侧边栏底部区域 */
.sidebar-footer {
    margin-top: auto;
    padding: 8px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logout-btn:hover {
    color: white;
    background: rgba(245, 87, 108, 0.5);
}

.sidebar-logout-btn i {
    font-size: 18px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-nav.collapsed .sidebar-logout-btn {
    justify-content: center;
    padding: 12px;
}

.sidebar-nav.collapsed .sidebar-logout-btn .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* 顶部用户栏 */
.topbar {
    height: 48px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.topbar-user {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.topbar-user:hover {
    background: rgba(102, 126, 234, 0.08);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.topbar-user-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.topbar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    overflow: hidden;
    display: none;
    z-index: 1001;
}

.topbar-dropdown.show {
    display: block;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.topbar-dropdown-item:hover {
    background: #f5f7fa;
}

.topbar-dropdown-item.logout {
    color: #f5576c;
}

.topbar-dropdown-item.logout:hover {
    background: rgba(245, 87, 108, 0.08);
}

.topbar-dropdown-item i {
    font-size: 16px;
    flex-shrink: 0;
}

/* 主内容区域 */
.main-content {
    flex-grow: 1;
    min-height: 100vh;
    background-color: var(--bg-color);
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.module-content {
    width: 100%;
    overflow-y: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ==================== 页面头部 ==================== */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px 40px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.page-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 14px;
}

/* ==================== 卡片样式 ==================== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    background: var(--card-bg);
}

/* ==================== 按钮样式 ==================== */
.btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: white;
}

.btn-outline-secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== 输入框样式 ==================== */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* ==================== 商品列表样式（参考商品榜单样式） ==================== */
/* 🔴 表格固定布局，防止变形 */
.product-list-table {
    table-layout: fixed !important;
    width: 100%;
}

.product-list-table img {
    max-width: 100%;
}

.title-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-list-table .product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-list-table .product-title a:hover {
    color: #667eea;
    text-decoration: underline;
}

.product-list-table .product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.product-list-table .product-price {
    font-size: 18px;
    font-weight: 600;
    color: #f56c6c;
}

.product-list-table .product-brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-list-table .product-brand i {
    font-size: 11px;
}

/* ==================== 模态框样式 ==================== */
.modal-xl {
    max-width: 1400px;
}

.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

/* ==================== 标签页样式 ==================== */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
}

/* ==================== 编辑区域样式 ==================== */
.edit-main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 991px) {
    .edit-main-content {
        grid-template-columns: 1fr;
    }
}

.edit-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.edit-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-card-title i {
    color: var(--primary-color);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label.required::after {
    content: '*';
    color: var(--danger-color);
    margin-left: 4px;
}

/* ==================== 媒体上传区域 ==================== */
.media-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.media-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.media-upload-area.drag-over {
    border-color: var(--primary-color);
    border-style: solid;
    background: rgba(102, 126, 234, 0.1);
}

.media-upload-area .upload-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.media-upload-area .upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.media-upload-area .upload-hint {
    color: var(--text-disabled);
    font-size: 12px;
    margin-top: 8px;
}

/* ==================== 图片网格 ==================== */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.image-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: move;
}

.image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item:hover .image-actions {
    opacity: 1;
}

.image-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-actions button {
    background: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-actions button:hover {
    transform: scale(1.1);
}

.image-actions .btn-delete {
    color: var(--danger-color);
}

.image-actions .btn-preview {
    color: var(--primary-color);
}

.image-actions .btn-ai {
    color: #7c3aed;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border: 1px solid #c4b5fd;
}

.image-actions .btn-ai:hover {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
    color: white;
}

/* ==================== 添加图片按钮 ==================== */
.add-image-btn {
    width: 100%;
    padding-bottom: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.add-image-btn:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.add-image-btn-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.add-image-btn i {
    font-size: 32px;
    color: var(--text-disabled);
    display: block;
    margin-bottom: 4px;
}

.add-image-btn span {
    font-size: 12px;
    color: var(--text-disabled);
}

/* ==================== 视频预览 ==================== */
.video-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview video {
    width: 100%;
    max-height: 300px;
    display: block;
    object-fit: contain;
}

.video-preview .video-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-preview .video-remove:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

/* ==================== 属性列表 ==================== */
.attributes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attribute-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.attribute-item .form-control {
    flex: 1;
}

.attribute-item .btn-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 只读信息区域 ==================== */
.readonly-info {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 16px;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 100px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    color: var(--text-primary);
}

/* ==================== SKU图片容器 ==================== */
.sku-image-container {
    width: 60px;
    height: 60px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sku-image-container:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.sku-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sku-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.sku-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sku-image-wrapper:hover .sku-image-actions {
    opacity: 1;
}

.sku-image-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sku-image-actions button {
    background: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 0;
}

.sku-image-actions button:hover {
    transform: scale(1.1);
}

.sku-image-actions .btn-delete {
    color: var(--danger-color);
}

.sku-image-actions .btn-preview {
    color: var(--primary-color);
}

.sku-image-actions button i {
    font-size: 12px;
}

.sku-image-placeholder {
    font-size: 24px;
    color: var(--text-disabled);
}

/* ==================== 规格设置样式 ==================== */
.spec-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.spec-name-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.spec-values-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.spec-value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.spec-value-badge:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spec-value-badge .remove-icon {
    cursor: pointer;
    color: var(--text-disabled);
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.spec-value-badge .remove-icon:hover {
    color: var(--danger-color);
}

.spec-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.spec-name-label {
    min-width: 80px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.spec-name-input {
    max-width: 200px;
    border: 1px solid #e1e1e1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.spec-name-input:focus {
    border-color: #4e6ef2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 110, 242, 0.1);
}

.spec-name-edit-btn {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.spec-values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.spec-value-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.spec-value-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spec-value-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    padding: 4px;
    min-width: 0;
    outline: none;
}

.spec-value-input:focus {
    background: white;
    border-radius: 4px;
}

.spec-value-remove {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-disabled);
    transition: color 0.3s ease;
    border-radius: 50%;
}

.spec-value-remove:hover {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.spec-add-value-btn {
    grid-column: span 3;
    padding: 8px;
    text-align: center;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.spec-add-value-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(78, 110, 242, 0.05);
}

@media (max-width: 768px) {
    .spec-values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .spec-add-value-btn {
        grid-column: span 2;
    }
}

/* ==================== 状态开关样式 ==================== */
.status-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.status-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.status-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.status-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .status-slider {
    background-color: #28a745;
}

input:checked + .status-slider:before {
    transform: translateX(26px);
}

.status-slider:hover {
    box-shadow: 0 0 1px #2196F3;
}

.status-label {
    font-size: 12px;
    margin-left: 8px;
    color: var(--text-secondary);
}

/* ==================== 分页组件样式 ==================== */
.baidu-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.baidu-pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.baidu-page-item {
    list-style: none;
}

.baidu-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f7f7f7;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.baidu-page-link:hover:not(.disabled) {
    background-color: #fff;
    border-color: #4e6ef2;
    color: #4e6ef2;
    box-shadow: 0 2px 4px rgba(78, 110, 242, 0.1);
    transform: translateY(-1px);
}

.baidu-page-link:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(78, 110, 242, 0.1);
}

.baidu-page-item.active .baidu-page-link {
    background-color: #4e6ef2;
    border-color: #4e6ef2;
    color: white;
    cursor: default;
    font-weight: 600;
}

.baidu-page-item.active .baidu-page-link:hover {
    transform: none;
}

.baidu-page-item.disabled .baidu-page-link {
    background-color: #f7f7f7;
    border-color: #e1e1e1;
    color: #c0c0c0;
    cursor: not-allowed;
    opacity: 0.6;
}

.baidu-page-item.disabled .baidu-page-link:hover {
    background-color: #f7f7f7;
    border-color: #e1e1e1;
    color: #c0c0c0;
    transform: none;
    box-shadow: none;
}

.baidu-page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #999;
    cursor: default;
    user-select: none;
}

.baidu-page-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    padding: 0 8px;
    white-space: nowrap;
}

.baidu-page-info-highlight {
    color: #4e6ef2;
    font-weight: 600;
}

/* ==================== SKU表格样式优化 ==================== */
.table-responsive table {
    table-layout: fixed;
    width: 100%;
}

.table-responsive table thead th:nth-child(1) {
    width: 35%;
    min-width: 200px;
}

.table-responsive table thead th:nth-child(2) {
    width: 100px;
}

.table-responsive table thead th:nth-child(3),
.table-responsive table thead th:nth-child(4) {
    width: 120px;
}

.table-responsive table thead th:nth-child(5) {
    width: 25%;
    min-width: 150px;
}

.table-responsive table tbody td:nth-child(1),
.table-responsive table tbody td:nth-child(5) {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    position: relative;
}

.table-responsive table tbody td:nth-child(1):hover,
.table-responsive table tbody td:nth-child(5):hover {
    overflow: visible;
    white-space: normal;
    background: #f8f9fa;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: help;
}

.table-responsive table tbody td[title] {
    cursor: help;
}

/* ==================== 其他组件样式 ==================== */
.sku-detail-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    margin-right: 8px;
}

.upload-selector {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.upload-selector button {
    display: block;
    width: 100%;
    margin: 4px 0;
    text-align: left;
    white-space: nowrap;
}

.detail-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.detail-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.form-text {
    font-size: 12px;
    color: var(--text-disabled);
    margin-top: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.file-upload-input {
    display: none;
}

.image-counter {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.image-counter.warning {
    color: var(--warning-color);
}

.image-counter.danger {
    color: var(--danger-color);
}

/* ==================== 复选框样式 ==================== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0d6efd;
}

input[type="checkbox"]:hover {
    transform: scale(1.1);
}

#selectAll {
    width: 20px;
    height: 20px;
}

/* ==================== 每页显示条数选择器 ==================== */
.page-size-select {
    width: 100px !important;
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-size-select option {
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: #333;
}

.page-size-select option:hover {
    background: #f0f7ff;
    color: #1890ff;
}

.page-size-select option:checked {
    background: #1890ff;
    color: #fff;
    font-weight: 600;
}

.page-size-select:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.15);
}

.page-size-select:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

/* ==================== 查询条件展开/收起 ==================== */
.search-row {
    transition: all 0.3s ease;
}

.search-row.collapsed {
    display: none !important;
}

.toggle-search-btn {
    padding: 4px 12px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #1890ff;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.toggle-search-btn:hover {
    border-color: #1890ff;
    color: #40a9ff;
}

.toggle-search-btn i {
    transition: transform 0.3s ease;
}

.toggle-search-btn.collapsed i {
    transform: rotate(180deg);
}

/* ==================== 分页容器 ==================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    background: #fff;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    user-select: none;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: #e6e6e6;
    border-color: #bfbfbf;
    color: #333;
    transform: translateY(-1px);
}

.page-btn:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
    font-weight: 500;
    cursor: default;
}

.page-btn.disabled {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #bfbfbf;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-ellipsis {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    cursor: default;
    user-select: none;
}

.page-btn.prev-btn,
.page-btn.next-btn {
    padding: 0 16px;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination-wrapper {
    animation: fadeInUp 0.4s ease;
}

.baidu-pagination-loading {
    opacity: 0.5;
    pointer-events: none;
}

#productTableBody {
    transition: opacity 0.3s ease;
}

.pagination-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .baidu-pagination {
        gap: 4px;
    }

    .baidu-page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }

    .baidu-page-ellipsis {
        min-width: 32px;
        height: 32px;
    }

    .baidu-page-info {
        font-size: 12px;
        padding: 0 4px;
    }

    .baidu-page-item.hide-mobile {
        display: none;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }

    .page-btn.prev-btn,
    .page-btn.next-btn {
        padding: 0 12px;
    }

    .page-ellipsis {
        min-width: 24px;
        height: 32px;
    }

    .page-btn.hide-mobile {
        display: none !important;
    }
}


/* ==================== AI��ʾ�������ı�����ʽ ==================== */
.ai-prompt-textarea {
    min-height: 300px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.ai-prompt-textarea:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.ai-prompt-textarea::placeholder {
    color: #999;
    font-style: italic;
}



/* ==================== AIģ�͹���ҳ����ʽ ==================== */
/* ģ��ѡ�������� */
.model-selector-container {
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* ģ��ѡ������������ʽ */
.model-selector-container select {
    font-size: 14px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.model-selector-container select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.model-selector-container select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* AIģ�ͱ�����ʽ */
#aiModelTableBody code {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
}


/* ==================== ��Ʒ����Tab������ʽ ==================== */
#productManageTabs {
    border-bottom: 2px solid var(--border-color);
}

#productManageTabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

#productManageTabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

#productManageTabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

#productManageTabs .nav-link i {
    margin-right: 6px;
}

/* Tab����Card��ʽ */
.card.mb-3 > .card-header:has(#productManageTabs) {
    background-color: var(--card-bg);
    border-bottom: none;
    padding: 0 16px;
}

/* ȷ��Tab�����ɼ� */
#productModule #productManageTabs {
    display: flex !important;
}

#productModule #productManageTabs .nav-item {
    display: block !important;
}

#productModule #productManageTabs .nav-link {
    display: flex !important;
    align-items: center;
}
