/* 基础样式 */
.aps-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aps-overlay.aps-open {
    opacity: 1;
    visibility: visible;
}

.aps-sidebar {
    width: 480px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.aps-overlay.aps-open .aps-sidebar {
    transform: translateX(0);
}

.aps-sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aps-sidebar-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.aps-sidebar-header span {
    font-size: 16px;
    font-weight: 500;
}

.aps-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aps-close-btn:hover {
    color: #ff0000;
}

.aps-loading,
.aps-no-results,
.aps-error {
    flex: 1;
    padding: 30px 15px;
    text-align: center;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aps-products-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* 商品卡片样式 */
.product-item {
    display: flex;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.product-image {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

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

.product-details {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.product-price {
    margin-bottom: 10px;
}

.aps-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.aps-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.aps-tab.active {
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
    font-weight: 500;
}

.aps-tab:hover {
    background: #e9ecef;
}

.text-xl.text-danger {
    font-size: 16px;
    font-weight: bold;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    margin-left: 5px;
    font-size: 12px;
}

.btn.btn-danger {
    padding: 5px 10px;
    font-size: 12px;
}

/* 浅色主题样式 */
html:not(.io-black-mode) .aps-sidebar {
    background: #fff;
    color: #333;
}

html:not(.io-black-mode) .aps-sidebar-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

html:not(.io-black-mode) .aps-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

html:not(.io-black-mode) .aps-tab {
    background: #f8f9fa;
    color: #333;
}

html:not(.io-black-mode) .aps-tab.active {
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
}

html:not(.io-black-mode) .aps-tab:hover {
    background: #e9ecef;
}

html:not(.io-black-mode) .product-item {
    border: 1px solid #eee;
    background: #fff;
}

html:not(.io-black-mode) .product-image {
    background: #f8f9fa;
}

html:not(.io-black-mode) .aps-close-btn {
    color: #999;
}

html:not(.io-black-mode) .aps-loading,
html:not(.io-black-mode) .aps-no-results,
html:not(.io-black-mode) .aps-error {
    color: #666;
}

/* 深色主题样式 */
html.io-black-mode .aps-sidebar {
    background: #1e1e1e;
    color: #fff;
}

html.io-black-mode .aps-sidebar-header {
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

html.io-black-mode .aps-tabs {
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

html.io-black-mode .aps-tab {
    background: #2d2d2d;
    color: #fff;
}

html.io-black-mode .aps-tab.active {
    border-bottom: 2px solid #0073aa;
    color: #0073aa;
}

html.io-black-mode .aps-tab:hover {
    background: #3d3d3d;
}

html.io-black-mode .product-item {
    border: 1px solid #444;
    background: #2d2d2d;
}

html.io-black-mode .product-image {
    background: #3d3d3d;
}

html.io-black-mode .aps-close-btn {
    color: #aaa;
}

html.io-black-mode .aps-loading,
html.io-black-mode .aps-no-results,
html.io-black-mode .aps-error {
    color: #ccc;
}

@media (max-width: 768px) {
    .aps-sidebar {
        width: 100%;
    }
}