/* 商标分类系统通用样式 */

.trademark-container {
    padding: 20px 0;
    min-height: 500px;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-box button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-box button:hover {
    background-color: #0056b3;
}

/* 大类选择器 */
.class-selector {
    margin-bottom: 20px;
}

.class-selector label {
    margin-right: 10px;
    font-weight: bold;
}

.class-selector select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 空消息 */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* 大类详情容器 */
#class-detail-container {
    margin-top: 20px;
}

.class-detail {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.class-header {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.class-header h2 {
    margin: 0;
    color: #007bff;
}

.class-description {
    margin: 15px 0;
    line-height: 1.6;
    color: #555;
}

.class-comments {
    margin: 15px 0;
}

.class-comments h4 {
    margin: 10px 0 5px 0;
    color: #333;
}

.class-comments ul {
    margin: 0;
    padding-left: 20px;
}

.class-comments li {
    margin: 5px 0;
    line-height: 1.5;
}

/* 类似群样式 */
.class-groups {
    margin-top: 20px;
}

.group-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.group-header {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
    cursor: pointer;
}

.group-header:hover {
    text-decoration: underline;
}

.group-items {
    margin-top: 10px;
    padding-left: 20px;
}

.item-list {
    list-style: none;
    padding: 0;
}

.item-list li {
    padding: 5px 0;
    border-bottom: 1px dotted #eee;
}

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

/* 高亮搜索关键词 */
.highlight {
    background-color: #ffeb3b;
    font-weight: bold;
    padding: 2px 4px;
}

/* 搜索结果表格 */
.search-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.search-results-table th,
.search-results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.search-results-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.search-results-table tr:hover {
    background-color: #f9f9f9;
}

.search-results-table .item-name {
    cursor: pointer;
    color: #007bff;
}

.search-results-table .item-name:hover {
    text-decoration: underline;
}

.search-results-table .item-name.selected {
    color: #28a745;
    font-weight: bold;
}

/* 已选择项容器 */
.selected-items-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.selected-items-section h3 {
    margin-top: 0;
}

.selected-items-group {
    margin-bottom: 20px;
}

.selected-items-group h4 {
    color: #007bff;
    margin-bottom: 10px;
}

.selected-item {
    display: inline-block;
    padding: 5px 10px;
    margin: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.selected-item .remove-btn {
    margin-left: 8px;
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
}

.selected-item .remove-btn:hover {
    text-decoration: underline;
}

.selected-actions {
    margin-top: 15px;
}

.selected-actions button {
    margin-right: 10px;
}

/* 购物车按钮样式 */
.btn-cart, .btn-saved {
    position: relative;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cart:hover, .btn-saved:hover {
    background-color: #218838;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 商品项样式 */
.trademark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    position: relative;
}

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

.trademark-item .item-name {
    flex: 1;
}

.btn-add-to-cart {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    padding: 0 !important;
    background-color: #fff !important;
    color: #999 !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 16px !important;
    line-height: 1 !important;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    position: relative !important;
    overflow: visible !important;
    opacity: 0.7 !important;
    margin: 0 !important;
    margin-left: 8px !important;
    box-sizing: border-box !important;
    z-index: 10 !important;
    visibility: visible !important;
}

.btn-add-to-cart::before {
    content: '+' !important;
    display: block !important;
    font-weight: normal !important;
    transition: all 0.2s ease;
    line-height: 1 !important;
    font-size: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 确保按钮内容为空时也显示+号 */
.btn-add-to-cart:empty::before {
    content: '+' !important;
}

.btn-add-to-cart:hover {
    background-color: #f0f0f0 !important;
    border-color: #007bff !important;
    color: #007bff !important;
    transform: scale(1.1);
    opacity: 1 !important;
}

.btn-add-to-cart.selected {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    cursor: default;
    opacity: 1 !important;
}

.btn-add-to-cart.selected::before {
    content: '✓' !important;
    font-weight: bold;
}

.btn-add-to-cart.selected:hover {
    background-color: #28a745;
    border-color: #28a745;
    transform: scale(1);
}

.btn-add-to-cart .check-icon {
    display: none;
}

/* 已选中的商品项样式 */
.trademark-item.item-selected {
    background-color: #f0f8ff;
    border-left: 3px solid #28a745;
    padding-left: 5px;
}

.trademark-item.item-selected .item-name {
    color: #28a745;
    font-weight: 500;
}

/* 商品选中动画 */
@keyframes itemSelectedPulse {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: #e3f2fd;
        transform: scale(1.02);
    }
    100% {
        background-color: #f0f8ff;
        transform: scale(1);
    }
}

/* 按钮选中动画 */
@keyframes buttonSelectedScale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 购物车通知 */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification-success {
    background-color: #28a745;
}

.cart-notification-error {
    background-color: #dc3545;
}

/* 添加到购物车动画 */
.cart-add-animation {
    position: fixed;
    width: 40px;
    height: 40px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 10000;
    pointer-events: none;
    transform: translate(0, 0) scale(1);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* 购物车面板高亮动画 - 自然淡绿色光影，缓慢自然 */
.cart-sidebar-highlight {
    animation: cartSidebarPulse 2s ease-in-out;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
    transition: box-shadow 0.5s ease;
}

@keyframes cartSidebarPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5);
        transform: scale(1);
    }
    30% {
        box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0.4);
        transform: scale(1.01);
    }
    60% {
        box-shadow: 0 0 30px 10px rgba(129, 199, 132, 0.3);
        transform: scale(1.015);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
        transform: scale(1);
    }
}

/* 购物车模态框 */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

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

.cart-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.cart-modal-header h3 {
    margin: 0;
}

.cart-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-meta {
    font-size: 12px;
    color: #666;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-item-remove {
    padding: 5px 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.cart-item-remove:hover {
    background-color: #c82333;
}

.cart-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary {
    font-weight: bold;
    font-size: 18px;
}

/* 已保存组合模态框 */
.combinations-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

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

.combination-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.combination-item:hover {
    background-color: #f9f9f9;
}

.combination-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.combination-item-title {
    font-weight: bold;
    color: #007bff;
}

.combination-item-meta {
    font-size: 12px;
    color: #666;
}

.combination-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* 右侧购物车面板 */
.cart-sidebar {
    position: sticky;
    top: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.cart-sidebar-header {
    padding: 15px;
    border-bottom: 2px solid #007bff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cart-count-badge {
    background-color: #007bff;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: calc(100vh - 200px);
}

.cart-sidebar-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.cart-sidebar-footer .btn {
    margin-bottom: 10px;
}

.cart-sidebar-footer .btn:last-child {
    margin-bottom: 0;
}

/* 购物车分组显示 */
.cart-class-group {
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.cart-class-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
}

.cart-class-header:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cart-class-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    user-select: none;
    margin-left: 8px;
}

.cart-class-content {
    display: block;
}

.cart-class-title {
    color: var(--primary-color);
    font-size: 14px;
}

.cart-class-count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.cart-group-section {
    border-bottom: 1px solid #eee;
}

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

.cart-group-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.cart-group-header:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cart-group-toggle {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
    user-select: none;
    margin-left: auto;
}

.cart-group-items {
    display: block;
}

.cart-group-id {
    color: #007bff;
    font-weight: 500;
}

.cart-group-name {
    color: #666;
}

.cart-group-items {
    padding: 0;
    background: #fff;
}

.cart-item-row {
    position: relative;
    padding: 8px 35px 8px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-row:hover {
    background-color: #f9f9f9;
}

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

.cart-item-code {
    font-size: 12px;
    color: #666;
    font-family: monospace;
    min-width: 70px;
    flex-shrink: 0;
}

.cart-item-name {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    flex: 1;
}

.cart-item-remove-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #999;
    border: none;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 0;
}

.cart-item-remove-btn:hover {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

/* 删除按钮内容由JavaScript提供，移除CSS中的::before伪元素，避免重复显示 */
.cart-item-remove-btn::before,
.cart-item-remove-btn::after {
    display: none !important;
    content: none !important;
}

/* 空状态 */
.cart-sidebar-content .empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box input,
    .search-box button {
        width: 100%;
    }
    
    .search-results-table {
        font-size: 14px;
    }
    
    .search-results-table th,
    .search-results-table td {
        padding: 8px;
    }
    
    .cart-modal-content {
        width: 95%;
        padding: 15px;
/* 删除按钮内容由JavaScript提供，移除CSS中的::before伪元素，避免重复显示 */
.cart-item-remove-btn::before,
.cart-item-remove-btn::after {
    display: none !important;
    content: none !important;
}
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-add-to-cart {
        margin-top: 0;
        width: 24px;
        height: 24px;
    }
    
    .cart-sidebar {
        position: relative;
        top: 0;
        margin-top: 20px;
        max-height: none;
    }
    
    .cart-sidebar-content {
        max-height: 400px;
    }
}

