:root {
    --primary-red: #E70012;
    --primary-red-hover: #c40010;
    --bg-main: #f8fafc;
    --border-color: #eee;
    --border-light: #eee;
    --text-dark: #000;
    --text-muted: #333;
    --text-light: #999;
    --white: #ffffff;
    --container-width: 1560px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-muted);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    min-width: 320px;
    width: 100%;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    /* padding: 0 20px; */
}

input[type="checkbox"] {
    accent-color: var(--primary-red);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-dark);
}

.logo span {
    color: var(--primary-red);
}

.search-container {
    display: flex;
    width: 500px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 50px;
}

.search-cat {
    background: #f8fafc;
    padding: 0 15px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    cursor: pointer;
}

.search-input {
    flex-grow: 1;
    border: none;
    padding: 0 15px;
    font-size: 13px;
    outline: none;
}

.search-btn {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-red-hover);
}

.nav-tools {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-tools a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.nav-tools a:hover {
    color: var(--primary-red);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid var(--border-color);
    padding-left: 30px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.main-wrapper {
    padding: 40px 0;
    display: flex;
    gap: 40px;
}

.basket-section {
    flex-grow: 1;
}

.summary-section {
    width: 380px;
    flex-shrink: 0;
}

.page-title-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.item-counts {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.bulk-bar {
    background: var(--white);
    padding: 15px 30px;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.shop-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shop-header {
    background: rgba(248, 250, 252, 0.6);
    padding: 12px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vendor-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.verified-tag {
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 2px;
    color: var(--text-light);
    text-transform: uppercase;
}

.table-head {
    padding: 10px 30px;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
}

.product-row {
    padding: 25px 30px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;

    a {
        display: contents;
    }
}

.product-row:last-child {
    border-bottom: none;
}

.product-row:hover {
    background: #fafbfc;
}

.product-img {
    width: 80px;
    height: 80px;
    padding: 5px;
    border: 1px solid var(--border-light);
    background: var(--white);
    object-fit: contain;
    border-radius: 3px;
}

.product-text h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tag {
    font-size: 11px;
    font-weight: 600;
    background: #f8fafc;
    color: #666;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.price-display {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

.qty-box {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    height: 32px;
    background: var(--white);
    overflow: hidden;
}

.qty-btn {
    width: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    border-inline: 1px solid #eee;
}

.qty-error {
    color: var(--primary-red) !important;
}

.text-red {
    color: var(--primary-red) !important;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

.summary-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 4px;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.summary-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 25px;
}

.summary-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.total-price {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-red);
    text-align: right;
}

.btn-confirm {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(231, 0, 18, 0.2);
    transition: all 0.2s;
    width: 100%;
}

.btn-confirm:disabled {
    background: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-confirm:hover:not(:disabled) {
    background: var(--primary-red-hover);
    transform: translateY(-1px);
}

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--border-light);
    padding: 40px 0;
    background: var(--white);
}

.col-info {
    width: 40%;
}

.col-price {
    width: 20%;
    text-align: center;
}

.col-qty {
    width: 20%;
    text-align: center;
}

.col-total {
    width: 20%;
    text-align: right;
}

.btn-remove-all {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.icon-margin-right {
    margin-right: 5px;
}

.product-detail {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.product-checkbox {
    margin-top: 4px;
}

.spec-tags {
    display: flex;
    gap: 6px;
}

.unit-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.moq-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

.subtotal-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.btn-remove-item {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
}

.summary-icon {
    color: var(--border-color);
    font-size: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 13px;
}

.summary-label {
    color: var(--text-light);
    font-weight: 500;
}

.summary-value-dark {
    color: var(--text-muted);
    font-weight: 600;
}

.summary-value-italic {
    color: var(--text-light);
    font-weight: 600;
    font-style: italic;
}

.summary-total-wrapper {
    border-top: 1px solid var(--border-light);
    margin-top: 25px;
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.total-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.currency-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-align: right;
}

.summary-actions {
    margin-top: 35px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assurance-box {
    padding-top: 25px;
    border-top: 1px solid var(--bg-main);
    display: flex;
    gap: 12px;
}

.assurance-icon {
    color: var(--primary-red);
    font-size: 14px;
}

.assurance-desc {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
    line-height: 1.6;
}

.empty-basket {
    padding: 100px 0;
    background: var(--white);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    margin-top: 60px;
}

.empty-icon-container {
    width: 90px;
    height: 90px;
    background: #f8fafc;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: #e2e8f0;
    font-size: 36px;
}

.empty-msg {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 40px;
}

.empty-btn {
    background: var(--text-dark);
    color: var(--white);
    border: none;
    padding: 12px 40px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.empty-btn:hover {
    background-color: #E70012;
}

/* 1. 中等屏幕 (1024px - 1560px) */
@media (max-width: 1560px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 1200px) {
    .main-wrapper {
        flex-direction: column;
    }

    .summary-section {
        width: 100%;
    }

    .summary-card {
        position: static;
    }

    .search-container {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        width: 100%;
        margin-left: 0;
    }

    .nav-tools {
        width: 100%;
        justify-content: space-around;
        gap: 10px;
    }

    .user-profile {
        padding-left: 15px;
    }

    .page-title-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .table-head {
        display: none;
    }

    .product-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        position: relative;
    }

    .col-info,
    .col-price,
    .col-qty,
    .col-total {
        width: 100% !important;
        text-align: left !important;
        padding: 5px 0;
    }

    .col-price,
    .col-qty {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed var(--border-light);
    }

    .col-price::before {
        content: "Price:";
        font-size: 12px;
        color: var(--text-light);
    }

    .col-qty::before {
        content: "Quantity:";
        font-size: 12px;
        color: var(--text-light);
    }

    .col-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
    }

    .col-total::before {
        content: "Subtotal:";
        font-weight: 700;
        color: var(--text-dark);
    }

    .subtotal-amount {
        margin-bottom: 0;
    }

    .btn-remove-item {
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 20px;
    }

    .product-img {
        width: 60px;
        height: 60px;
    }

    .logo {
        font-size: 18px;
    }
}