/* 科呈通讯 - 亚马逊风格电商设计 */

:root {
    --primary-color: #FF9900;
    --primary-dark: #E88B00;
    --primary-light: #FEBD69;
    --secondary-color: #232F3E;
    --accent-color: #FF6B35;
    --dark-bg: #131921;
    --darker-bg: #0F1111;
    --light-bg: #F7F8F8;
    --text-dark: #0F1111;
    --text-gray: #565959;
    --border-color: #D5D9D9;
    --price-red: #B12704;
    --link-blue: #007185;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 12px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Microsoft YaHei', 'Amazon Ember', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #EAEDED;
    color: var(--text-dark);
    line-height: 1.5;
}

main {
    flex: 1;
}

/* 导航栏 - 亚马逊风格 */
.navbar {
    background: var(--secondary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0.6rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-brand i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-dark .navbar-nav .nav-link {
    color: #fff;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.navbar-dark .navbar-nav .nav-link:hover {
    border: 1px solid var(--primary-color);
    border-radius: 2px;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* 购物车图标 */
.fa-shopping-cart {
    color: #fff;
    font-size: 1.5rem;
}

/* 按钮样式 - 亚马逊风格 */
.btn-primary {
    background: linear-gradient(to bottom, #FFD76E, var(--primary-color));
    border: 1px solid #C47D00;
    border-radius: 8px;
    color: var(--darker-bg) !important;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #FFE08C, #FEBD69);
    border-color: #B07800;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #fff;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    color: var(--text-dark);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #F7F8F8;
    border-color: #888;
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-dark);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--darker-bg);
}

/* Product Cards - 亚马逊风格 */
.product-card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #DDD;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: #C47D00;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.product-card .card-img-top {
    object-fit: cover;
    height: 260px;
    width: 100%;
}

.product-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .card-title {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-title a {
    color: var(--link-blue);
    text-decoration: none;
}

.product-card .card-title a:hover {
    color: #C45500;
    text-decoration: underline;
}

.text-primary {
    color: var(--price-red) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.product-card .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    font-weight: 500;
}

/* Category Cards - 亚马逊风格 */
.category-card {
    background: white;
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid #DDD;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.category-card:hover {
    border-color: #C47D00;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h5 {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Footer - 亚马逊风格 */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer h5 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    color: #DDD;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer .text-center {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #DDD;
    font-size: 0.9rem;
}

/* 产品详情页 */
.product-detail-img {
    border-radius: 4px;
    border: 1px solid #DDD;
    max-width: 100%;
}

.product-info {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #DDD;
}

.product-info h1 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.product-info .price {
    font-size: 2rem;
    color: var(--price-red);
    font-weight: 700;
    margin: 1rem 0;
}

.product-info .spec-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #EEE;
    display: flex;
    justify-content: space-between;
}

.product-info .spec-item:last-child {
    border-bottom: none;
}

.product-info .spec-label {
    font-weight: 600;
    color: var(--text-dark);
}

.product-info .spec-value {
    color: var(--text-gray);
}

/* 购物车样式 */
.cart-item {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid #DDD;
}

.cart-item img {
    max-width: 120px;
    border-radius: 4px;
    border: 1px solid #EEE;
}

.cart-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #DDD;
    position: sticky;
    top: 20px;
}

.cart-summary h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cart-summary .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #EEE;
}

.cart-summary .summary-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--price-red);
}

/* Form样式 - 亚马逊风格 */
.form-control {
    border: 1px solid #888;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #E77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* 筛选侧边栏 */
.filter-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #DDD;
}

.filter-sidebar h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.filter-sidebar .form-check {
    margin-bottom: 0.75rem;
}

.filter-sidebar .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

/* Badge样式 */
.badge {
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
}

.badge.bg-success {
    background-color: #067D62 !important;
}

.badge.bg-danger {
    background-color: #B12704 !important;
}

.badge.bg-warning {
    background-color: #FF9900 !important;
    color: #0F1111;
}

/* 评分星星 */
.star-rating {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 面包屑导航 */
.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--link-blue);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #C45500;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-gray);
}

/* Alert样式 */
.alert {
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #DFF0D8;
    border-color: #D6E9C6;
    color: #3C763D;
}

.alert-danger {
    background-color: #F2DEDE;
    border-color: #EBCCD1;
    color: #A94442;
}

.alert-info {
    background-color: #D9EDF7;
    border-color: #BCE8F1;
    color: #31708F;
}

/* Table样式 */
.table {
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.table thead {
    background: #F7F8F8;
    border-bottom: 2px solid #DDD;
}

.table th {
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid #DDD;
}

.table td {
    vertical-align: middle;
}

/* Pagination */
.pagination .page-link {
    color: var(--link-blue);
    border: 1px solid #DDD;
    border-radius: 4px;
    margin: 0 2px;
}

.pagination .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary-dark);
    color: var(--darker-bg);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-dark);
    color: var(--darker-bg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .product-card .card-title {
        font-size: 0.9rem;
    }
    
    .text-primary {
        font-size: 1.25rem;
    }
    
    .cart-item {
        padding: 1rem;
    }
    
    .cart-item img {
        max-width: 80px;
    }
    
    .filter-sidebar {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .product-card .card-body {
        padding: 0.75rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* 加载动画优化 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #F7F8F8;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 工具提示 */
.tooltip-inner {
    background: var(--darker-bg);
    color: white;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

/* 选择下拉框 */
select.form-control,
select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* 输入组 */
.input-group {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-group .btn {
    border-left: none;
}

/* Card通用样式 */
.card {
    border-radius: 4px;
    border: 1px solid #DDD;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: #F7F8F8;
    border-bottom: 1px solid #DDD;
    font-weight: 600;
}

/* 链接样式 */
a {
    color: var(--link-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #C45500;
    text-decoration: underline;
}

/* 图片通用样式 */
img {
    max-width: 100%;
    height: auto;
}

/* 容器间距 */
.container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.625rem; }
h5 { font-size: 1.1rem; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; margin-bottom: 0.5rem; }

/* 消息提示样式 - 固定定位，不占用页面空间 */
.toast-container {
    pointer-events: none;
}

.toast-container .alert {
    pointer-events: auto;
    animation: slideDown 0.3s ease-out;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    padding: 1rem 1.5rem;
}

.toast-container .alert-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-left: 4px solid #1e7e34;
}

.toast-container .alert-error,
.toast-container .alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-left: 4px solid #bd2130;
}

.toast-container .alert-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    border-left: 4px solid #e0a800;
}

.toast-container .alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border-left: 4px solid #117a8b;
}

.toast-container .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.toast-container .btn-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 产品详情页专用样式 */
.product-image-section .card {
    transition: all 0.3s ease;
}

.product-image-section .card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.product-image-section img {
    transition: transform 0.3s ease;
}

.product-image-section .card:hover img {
    transform: scale(1.02);
}

/* 缩略图包装器 */
.thumbnail-wrapper {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thumbnail-wrapper:hover {
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.product-info-section .card {
    transition: all 0.3s ease;
}

.product-info-section .badge {
    transition: all 0.2s ease;
}

.product-info-section .badge:hover {
    transform: scale(1.05);
}

.variant-option {
    transition: all 0.3s ease;
    cursor: pointer;
}

.variant-option:hover {
    transform: translateX(5px);
}

.breadcrumb {
    transition: all 0.2s ease;
}

.breadcrumb-item a {
    color: var(--link-blue);
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* 产品详情页价格显示 */
#display-price {
    transition: transform 0.3s ease;
}

/* 产品详情页按钮 */
.product-info-section .btn {
    transition: all 0.3s ease;
}

.product-info-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

/* 产品详情页响应式 */
@media (max-width: 992px) {
    .product-image-section {
        margin-bottom: 2rem;
    }
    
    .product-info-section h1 {
        font-size: 1.5rem;
    }
    
    #display-price {
        font-size: 2rem !important;
    }
}

@media (max-width: 768px) {
    .product-image-section .card img {
        height: 300px !important;
    }
    
    .product-info-section h1 {
        font-size: 1.25rem;
    }
    
    #display-price {
        font-size: 1.75rem !important;
    }
    
    .variant-option {
        padding: 0.75rem !important;
    }
}
