:root {
    --theme-color: #002B5B;
    --theme-light: #1a4573;
    --theme-hover: #003875;
}

body {
    background-color: #f5f7fa;
}

.sidebar {
    background-color: var(--theme-color);
    min-height: 100vh;
    color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin: 10px;
}

.main-content {
    min-height: 100vh;
    background-color: #f5f7fa;
}



.card {
    border: none;
    border-radius: 0px;
}

.nav-link {
    color: #e0e0e0;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: var(--theme-hover);
    color: white;
    transform: translateX(5px);
}

.nav-link.active {
    background-color: var(--theme-light);
    color: white;
    font-weight: 500;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.card-body {
    padding: 10px;
}

.card-title {
    color: var(--theme-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
}

.product-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    margin-right: 10px;
}

h2 {
    color: var(--theme-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h4.text-center {
    font-size: 1.3rem;
    padding: 1.2rem 0;
}

.card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.recent-activity {
    margin-top: 2rem;
}

.recent-activity .card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
}

.mobile-nav {
    display: none;
    background-color: var(--theme-color);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-nav .navbar-brand {
    color: white;
    font-size: 1.2rem;
}

.mobile-nav .navbar-toggler {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.offcanvas {
    background-color: var(--theme-color);
    max-width: 280px;
}

.offcanvas-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-title {
    font-size: 1.2rem;
}

.offcanvas-body {
    padding: 1rem;
}

.navbar-toggler {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar-toggler:focus {
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 1rem !important;
    }

    .container-fluid {
        padding: 0;
    }
}

/* 修改关闭按钮样式 */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
}

.offcanvas-header .btn-close {
    margin: 0;
    padding: 0.5rem;
}

.quantity-display {
    font-size: 1rem;
    color: #333;
    text-align: center;
    font-weight: 500;
}

/* 修改表格对齐方式 */
.table th {
    text-align: center;
}

.table td {
    text-align: center;
    vertical-align: middle;
}

.table td:nth-child(2) {
    /* 商品信息列左对齐 */
    text-align: left;
}

/* 移动端样式 */
@media (max-width: 768px) {

    /* 隐藏PC端表格 */
    .pc-cart-table {
        display: none;
    }

    .main-content {
        padding: 0 !important;
    }

    h2 {
        padding: 15px;
        margin: 0;
        background: #fff;
        font-size: 16px;
    }

    /* 移动端购物车样式 */
    .mobile-cart-item {
        background: #fff;
        padding: 10px;
        margin-top: 10px;
        position: relative;
    }

    .mobile-cart-header {
        display: none;
    }

    .mobile-cart-content {
        display: flex;
        align-items: center;
        padding: 10px;
    }

    .mobile-cart-img {
        width: 80px;
        height: 80px;
        border-radius: 4px;
        margin-right: 10px;
        object-fit: cover;
    }

    .mobile-cart-info {
        flex: 1;
        margin-right: 10px;
    }

    .mobile-cart-name {
        font-size: 14px;
        color: #333;
        margin-bottom: 5px;
        line-height: 1.4;
    }

    .mobile-cart-bottom {
        display: flex;
        align-items: center;
        margin-top: 10px;
    }

    .mobile-cart-price {
        color: #ff4d4f;
        font-size: 16px;
        font-weight: 500;
    }

    .mobile-cart-quantity {
        color: #666;
        font-size: 16px;
        margin-left: 10px;
        border: none;
        background: none;
    }

    /* 移动端结算栏 */
    .mobile-checkout-bar {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        background: white;
        padding: 10px 15px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-checkout-left {
        display: flex;
        align-items: center;
    }

    .mobile-checkout-right {
        display: flex;
        align-items: center;
    }

    .mobile-total-price {
        margin-right: 10px;
        text-align: right;
    }

    .mobile-checkout-btn {
        background: #ff4d4f;
        color: white;
        border: none;
        padding: 5px 15px;
        border-radius: 20px;
    }

    /* 为固定结算栏预留空间 */
    .main-content {
        padding-bottom: 130px !important;
    }

    /* 调整选择框样式 */
    .form-check {
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
    }

    .form-check-input {
        margin: 0;
    }

    .form-check .form-check-input {
        margin-left: 0 !important;
        margin-right: 5px !important;
    }

    /* 删除按钮样式 */
    .mobile-cart-delete {
        border: none;
        background: none;
        color: #999;
        padding: 8px;
        margin-left: 10px;
    }

    .mobile-cart-delete i {
        font-size: 16px;
    }
}