:root {
    --jd-red: #e1251b;
    --jd-dark-red: #c81623;
    --bg-gray: #f5f5f5;
    --text-dark: #333;
    --text-light: #666;
    --text-weak: #999;
    --border: #e8e8e8;
    --star-color: #ff9500;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft Yahei", "PingFang SC", Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    font-size: 14px;
    overflow-x: hidden;       /* 防止移动端横向溢出 */
}

/* 移动端：让 sticky 顶部导航不超出视口 */
@media (max-width: 768px) {
    html { overflow-x: hidden; }
}

a {
    text-decoration: none;
}

/* 通用图标 */
.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-lg {
    width: 22px;
    height: 22px;
}

/* ==================== 顶部导航 ==================== */
.nav-top {
    background: var(--jd-red);
    padding: 10px 0;
    color: white;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 2px solid var(--jd-dark-red);
}

.nav-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 15px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 6px;
    cursor: pointer;
    color: white;
    flex-shrink: 0;
}

.logo img {
    height: 38px;
}

.logo-text {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 1px;
}

/* 顶部一级分类 */
.category-nav {
    display: flex;
    gap: 2px;
    position: relative;
}

.category-item {
    position: relative;
}

.category-item a {
    color: white;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 3px;
    transition: background 0.2s;
    display: block;
    white-space: nowrap;
}

.category-item a:hover,
.category-item a.active {
    background: var(--jd-dark-red);
}

/* 二级菜单 */
.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 1000;
    padding: 6px 0;
    min-width: 170px;
    border: 1px solid #f0f0f0;
}

.sub-menu a {
    display: block;
    color: var(--text-dark);
    padding: 9px 16px;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}

.sub-menu a:hover {
    background: var(--bg-gray);
    color: var(--jd-red);
}

.category-item:hover .sub-menu {
    display: block;
}

/* ==================== 搜索框 ==================== */
.search-box {
    flex: 1;
    max-width: 420px;
    min-width: 200px;
    position: relative;
    display: flex;
    background-color: white;
    border-radius: 3px;
    border: 2px solid #f0f0f0;
    overflow: visible;
}

.search-box input {
    flex: 1;
    width: 100%;
    padding: 9px 14px;
    border: none;
    font-size: 14px;
    outline: none;
    background-color: white;
    min-width: 0;
}

.search-box input::placeholder {
    color: #b0b0b0;
}

.search-box .search-btn {
    padding: 0 16px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--jd-red);
    color: white;
    flex-shrink: 0;
    transition: background 0.2s;
}

.search-box .search-btn .icon {
    width: 18px;
    height: 18px;
}

.search-box .search-btn:hover {
    background-color: var(--jd-dark-red);
}

/* 搜索建议 */
.suggestions-container {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
    padding: 6px 0;
    border: 1px solid #f0f0f0;
}

.suggest-section {
    padding: 4px 0;
}

.suggest-section + .suggest-section {
    border-top: 1px solid #f4f4f4;
}

.suggest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 2px;
}

.suggest-label {
    font-size: 12px;
    color: var(--text-weak);
    line-height: 1;
}

.hot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px 8px;
}

.hot-kw {
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-gray);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.hot-kw:hover {
    color: var(--jd-red);
    background: #fdeceb;
}

.suggest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 2px;
}

.suggest-clear-history {
    border: none;
    background: none;
    color: var(--jd-red);
    font-size: 12px;
    cursor: pointer;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--bg-gray);
}

.suggestion-item img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.suggest-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.suggest-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggest-price {
    color: var(--jd-red);
    font-weight: bold;
    font-size: 13px;
}

.history-item {
    color: var(--text-light);
}

.suggestion-empty {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-weak);
    font-size: 13px;
}

/* 顶部用户入口 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-action {
    color: white;
    font-size: 13px;
    padding: 7px 10px;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.nav-action:hover {
    background: var(--jd-dark-red);
}

.nav-action-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #fff;
    color: var(--jd-red);
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: bold;
}

.admin-link {
    color: white;
    font-size: 13px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 3px;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-link:hover {
    background: var(--jd-dark-red);
    border-color: var(--jd-dark-red);
}

/* ==================== 主区域布局 ==================== */
.promo-section {
    width: 100%;
    max-width: 1300px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 16px;
    padding: 0 15px;
}

/* 侧边分类导航 */
.side-nav {
    background: white;
    border-radius: 4px;
    padding: 10px;
    box-shadow: var(--shadow);
    align-self: start;
    border: 1px solid #f0f0f0;
}

.side-cat-group {
    margin-bottom: 4px;
}

.side-cat-group .side-cat-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    font-size: 15px;
    font-weight: bold;
    color: var(--text-dark);
    border-radius: 3px;
    transition: all 0.2s;
}

.side-cat-main:hover {
    color: var(--jd-red);
}

.side-cat-main.active {
    color: var(--jd-red);
    background: #fdeceb;
}

.side-cat-group ul {
    list-style: none;
    padding-left: 6px;
}

.side-cat-group li a {
    color: var(--text-light);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px 7px 18px;
    border-radius: 3px;
    font-size: 13px;
    border-left: 2px solid transparent;
}

.side-cat-group li a:hover {
    color: var(--jd-red);
    background-color: #fafafa;
}

.side-cat-group li a.active {
    color: var(--jd-red);
    border-left-color: var(--jd-red);
    background: #fdeceb;
    font-weight: bold;
}

.cat-count {
    font-size: 11px;
    color: #b0b0b0;
    background: #f5f5f5;
    border-radius: 3px;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

.side-cat-group li a.active .cat-count,
.side-cat-main.active .cat-count {
    background: #ffe0de;
    color: var(--jd-red);
}

/* ==================== 轮播海报 ==================== */
.promo-banner {
    flex: 1;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 240px;
    border: 1px solid #f0f0f0;
}

.promo-banner a {
    display: block;
    width: 100%;
    height: 100%;
}

.promo-banner img {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: left 0.8s ease-in-out;
}

.promo-banner img.active {
    left: 0;
}

.promo-banner img.prev {
    left: -100%;
}

/* ==================== 首页楼层（热卖/最近浏览） ==================== */
.home-floor {
    width: 100%;
    max-width: 1300px;
    margin: 16px auto 0;
    padding: 0 15px;
}

.floor-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 2px 12px;
}

.floor-title {
    font-size: 18px;
    font-weight: bold;
    position: relative;
    padding-left: 12px;
    line-height: 1.4;
}

.floor-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background: var(--jd-red);
    border-radius: 2px;
}

.floor-sub {
    font-size: 12px;
    color: var(--text-weak);
}

/* 热卖网格 */
.floor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hot-card {
    background: white;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.hot-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.hot-img-wrap {
    display: block;
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 3px;
    background: #f8f8f8;
    margin-bottom: 10px;
}

.hot-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hot-card:hover .hot-img-wrap img {
    transform: scale(1.05);
}

.hot-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.hot-name {
    font-size: 13px;
    font-weight: normal;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.hot-name:hover {
    color: var(--jd-red);
}

.hot-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.hot-price {
    color: var(--jd-red);
    font-size: 16px;
    font-weight: bold;
}

.hot-sales {
    font-size: 12px;
    color: var(--text-weak);
}

.hot-card .quick-add {
    padding: 7px 0;
    font-size: 13px;
}

/* 最近浏览横条 */
.floor-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.floor-scroll::-webkit-scrollbar {
    height: 6px;
}

.floor-scroll::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.recent-card {
    flex: 0 0 120px;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.recent-card:hover {
    box-shadow: var(--shadow-hover);
}

.recent-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 3px;
    background: #f8f8f8;
}

.recent-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
}

.recent-name {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-price {
    font-size: 13px;
    color: var(--jd-red);
    font-weight: bold;
}

/* ==================== 商品浏览区 ==================== */
.product-section {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px 40px;
}

/* 面包屑 */
.breadcrumb {
    padding: 14px 2px 6px;
    font-size: 13px;
    color: var(--text-weak);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-light);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--jd-red);
}

.crumb-sep {
    color: #ccc;
}

.crumb-current {
    color: var(--jd-red);
    font-weight: bold;
}

/* 筛选条件栏 */
.filter-bar {
    padding: 10px 2px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    color: var(--text-light);
}

.filter-chip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-item {
    background: white;
    border: 1px solid var(--jd-red);
    color: var(--jd-red);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 3px;
}

.filter-clear {
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.filter-clear:hover {
    color: var(--jd-red);
}

/* 排序栏 */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    padding: 6px 14px;
    margin: 14px 0 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.sort-options {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.sort-btn {
    border: none;
    background: none;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.sort-btn:hover {
    color: var(--jd-red);
}

.sort-btn.active {
    color: var(--jd-red);
    font-weight: bold;
    background: #fdeceb;
}

.sort-count {
    font-size: 12px;
    color: var(--text-weak);
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 4px;
    padding: 12px;
    transition: box-shadow 0.25s, transform 0.25s;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: #fde0df;
}

.card-img-wrap {
    position: relative;
    display: block;
    width: 100%;
    height: 200px;
    border-radius: 3px;
    overflow: hidden;
    background: #f8f8f8;
    cursor: pointer;
}

.card-img-wrap img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.35s ease;
}

.card-img-wrap img.loaded {
    opacity: 1;
}

.card-img-wrap:hover img {
    transform: scale(1.05);
}

.img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 37%, #f5f5f5 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

.card-img-wrap img.loaded~.img-skeleton,
.card-img-wrap img.loaded+.img-skeleton {
    display: none;
}

/* 折扣角标 */
.discount-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    background: var(--jd-red);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
}

/* 收藏心形 */
.fav-heart {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    opacity: 0;
}

.product-card:hover .fav-heart {
    opacity: 1;
}

.fav-heart.on {
    opacity: 1;
    color: var(--jd-red);
}

.fav-heart .icon {
    width: 15px;
    height: 15px;
}

.fav-heart:hover {
    transform: scale(1.1);
}

/* 卡片骨架屏 */
.skeleton-card {
    min-height: 320px;
    justify-content: flex-start;
    gap: 12px;
}

.skeleton-card .card-img-wrap {
    height: 200px;
}

.skeleton-line {
    height: 14px;
    border-radius: 3px;
    background: #ececec;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }

.shimmer {
    background: linear-gradient(90deg, #f5f5f5 25%, #ebebeb 37%, #f5f5f5 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.card-name {
    font-size: 14px;
    margin: 10px 0 4px;
    color: var(--text-dark);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.4;
}

.card-name:hover {
    color: var(--jd-red);
}

/* 评分与销量 */
.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12px;
}

.stars {
    color: var(--star-color);
    letter-spacing: 1px;
    font-size: 12px;
}

.rating-num {
    color: var(--star-color);
    font-weight: bold;
}

.rating-sales {
    color: #b0b0b0;
    margin-left: auto;
}

/* 价格区 */
.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.product-card .price {
    color: var(--jd-red);
    font-size: 18px;
    font-weight: bold;
}

.original-price {
    font-size: 12px;
    color: #b0b0b0;
    text-decoration: line-through;
}

.stock-info {
    font-size: 12px;
    color: var(--text-weak);
    margin-left: auto;
}

.stock-info.low {
    color: #e6a23c;
}

.stock-info.out {
    color: var(--text-weak);
}

.product-card .tags {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    margin-bottom: 10px;
    min-height: 20px;
    flex-wrap: wrap;
}

.product-card .tags span {
    background: #fdeceb;
    color: var(--jd-red);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
}

/* 快速加购 */
.quick-add {
    margin-top: auto;
    padding: 8px 0;
    background: var(--jd-red);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.quick-add:hover {
    background: var(--jd-dark-red);
}

.quick-add:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 加载状态 */
.loading,
.no-more {
    text-align: center;
    margin: 22px 0;
    font-size: 14px;
    color: var(--text-weak);
}

.loading {
    display: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid #e5e5e5;
    border-top-color: var(--jd-red);
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 加载更多按钮 */
.load-more-btn {
    display: none;
    margin: 22px auto 0;
    padding: 10px 40px;
    background: white;
    color: var(--jd-red);
    border: 1px solid var(--jd-red);
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--jd-red);
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    background: white;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.empty-svg {
    width: 56px;
    height: 56px;
    color: #d0d0d0;
    margin-bottom: 14px;
}

.empty-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.empty-desc {
    font-size: 13px;
    color: var(--text-weak);
    margin-bottom: 20px;
}

.empty-reset {
    padding: 8px 26px;
    background: var(--jd-red);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.empty-reset:hover {
    background: var(--jd-dark-red);
}

/* ==================== 收藏夹 / 订单视图 ==================== */
.view-section {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 10px 15px 50px;
    min-height: 60vh;
}

.view-title {
    font-size: 18px;
    padding: 16px 2px;
}

.view-sub {
    font-size: 13px;
    color: var(--text-weak);
    font-weight: normal;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-card {
    background: white;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.order-card:hover {
    box-shadow: var(--shadow-hover);
}

.order-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 11px 18px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.order-no {
    font-family: Consolas, monospace;
    color: var(--text-weak);
}

.order-time {
    color: #b0b0b0;
}

.status-pill {
    margin-left: auto;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.status-pill.待发货 {
    background: #fdf3e3;
    color: #e6a23c;
}

.status-pill.已发货 {
    background: #e6f2ff;
    color: #409eff;
}

.status-pill.已完成 {
    background: #e8f7ee;
    color: #1a9e4b;
}

.order-body {
    display: flex;
    padding: 14px 18px;
    gap: 24px;
    flex-wrap: wrap;
}

.order-items {
    flex: 1;
    min-width: 260px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}

.order-item img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.order-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.order-item-spec {
    color: var(--text-weak);
    font-size: 12px;
    background: #f7f7f7;
    padding: 1px 8px;
    border-radius: 2px;
}

.order-item-qty {
    color: var(--text-weak);
    font-size: 13px;
}

.order-item-price {
    font-weight: bold;
    color: var(--jd-red);
    min-width: 70px;
    text-align: right;
}

.order-info {
    min-width: 220px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 2;
    border-left: 1px solid #f0f0f0;
    padding-left: 20px;
}

.order-total {
    display: flex;
    align-items: flex-end;
    font-size: 14px;
    color: var(--text-light);
}

.order-total b {
    color: var(--jd-red);
    font-size: 20px;
    margin-left: 6px;
}

/* ==================== 页脚 ==================== */
.site-footer {
    background: #22262e;
    color: #9aa0aa;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 38px 15px 28px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 19px;
    font-weight: bold;
    margin-bottom: 12px;
}

.footer-logo img {
    height: 32px;
}

.footer-brand p {
    font-size: 13px;
    line-height: 1.8;
}

.footer-col h4 {
    color: white;
    font-size: 14px;
    margin-bottom: 12px;
}

.footer-col a {
    display: block;
    color: #9aa0aa;
    font-size: 13px;
    padding: 4px 0;
    transition: all 0.2s;
}

.footer-col a:hover {
    color: white;
}

.pay-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pay-badge {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 3px;
    color: white;
    font-weight: bold;
}

.pay-badge.wx { background: #22b14c; }
.pay-badge.ali { background: #1677ff; }
.pay-badge.bank { background: #e6a23c; }

.footer-tip {
    font-size: 12px;
    line-height: 1.8;
}

.footer-bottom {
    border-top: 1px solid #333a45;
    padding: 14px 15px;
    text-align: center;
    font-size: 12px;
    color: #6d737d;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ==================== 粘性功能卡片 ==================== */
.sticky-card {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 998;
    width: 60px;
    align-items: center;
}

.sticky-card .card-item {
    background: white;
    border-radius: 4px;
    padding: 7px 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    width: 100%;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    gap: 2px;
    transition: all 0.2s;
    position: relative;
    border: 1px solid #f0f0f0;
}

.sticky-card .card-item:hover {
    border-color: var(--jd-red);
}

.sticky-card .card-item span {
    font-size: 11px;
    color: var(--text-dark);
}

.cart-label {
    font-size: 11px;
}

/* 购物车角标 */
.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--jd-red);
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: bold;
    border: 2px solid white;
}

.back-to-top {
    background: var(--jd-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.back-to-top:hover {
    background: var(--jd-dark-red);
}

/* ==================== 购物车面板 ==================== */
.cart-items {
    display: none;
    position: absolute;
    bottom: 62px;
    right: 0;
    width: 360px;
    max-height: 460px;
    overflow-y: auto;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.2s ease;
    z-index: 2000;
    border: 1px solid #eee;
}

.cart-items.show {
    display: block;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.check-all {
    display: flex !important;
    align-items: center;
    gap: 6px;
    position: static !important;
    transform: none !important;
    margin: 0 !important;
}

.check-all-text {
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
}

.cart-header-count {
    font-size: 12px;
    color: var(--text-weak);
}

.cart-empty {
    text-align: center;
    padding: 36px 20px;
}

.cart-empty p {
    font-size: 14px;
    color: var(--text-light);
}

.cart-empty-hint {
    color: var(--text-weak) !important;
    font-size: 12px !important;
    margin-top: 4px;
}

.cart-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 6px;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}

.cart-item-image {
    flex: 0 0 56px;
    height: 56px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    background: #fff;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s;
}

.cart-item-name:hover {
    color: var(--jd-red);
}

.cart-item-spec {
    font-size: 11px;
    color: var(--text-weak);
    background: #f7f7f7;
    padding: 1px 8px;
    border-radius: 2px;
    align-self: flex-start;
}

.cart-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cart-item-quantity {
    font-size: 13px;
    color: var(--text-light);
    min-width: 20px;
    text-align: center;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--jd-red);
    white-space: nowrap;
}

.cart-remove {
    border: none;
    background: none;
    color: #c0c0c0;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.cart-remove:hover {
    color: var(--jd-red);
}

/* 勾选框 */
.check-wrap {
    position: relative;
    display: block;
    cursor: pointer;
    flex-shrink: 0;
}

.check-wrap input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    z-index: 2;
}

.checkmark {
    display: block;
    width: 18px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s;
    background: white;
}

.check-wrap input:checked~.checkmark {
    background: var(--jd-red);
    border-color: var(--jd-red);
}

.checkmark::after {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.check-wrap input:checked~.checkmark::after {
    opacity: 1;
}

/* 数量控制 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--bg-gray);
    border-color: #ccc;
}

/* 结算栏 */
.cart-footer {
    padding: 10px 0 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

.cart-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-clear {
    border: none;
    background: none;
    color: var(--text-weak);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.cart-clear:hover {
    color: var(--jd-red);
    background: #fdeceb;
}

.total-amount {
    font-size: 13px;
    font-weight: bold;
    color: var(--jd-red);
    text-align: right;
}

.total-price {
    font-size: 17px;
}

.checkout-all {
    width: 100%;
    padding: 10px;
    background: var(--jd-red);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.checkout-all:hover {
    background: var(--jd-dark-red);
}

.checkout-all:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==================== 商品详情弹窗 ==================== */
.product-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    width: 92%;
    max-width: 960px;
    max-height: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    animation: fadeIn 0.25s ease;
    position: relative;
}

.modal-left {
    flex: 0 0 46%;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    position: relative;
}

.modal-left img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: 3px;
}

.discount-badge-large {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: var(--jd-red);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 2px;
}

.modal-right {
    flex: 1;
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    overflow-y: auto;
    min-width: 0;
}

.product-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
}

/* 评分区 */
.modal-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.modal-rating .stars {
    font-size: 13px;
}

.modal-rating .rating-num {
    color: var(--star-color);
    font-weight: bold;
}

.modal-rating .rating-sales {
    color: var(--text-weak);
}

.modal-rating .rating-sales b {
    color: var(--jd-red);
}

.modal-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.modal-category {
    font-size: 12px;
    color: var(--jd-red);
    background: #fdeceb;
    padding: 2px 10px;
    border-radius: 2px;
}

.modal-stock {
    font-size: 12px;
    color: var(--text-weak);
}

.modal-stock.out {
    color: var(--jd-red);
    font-weight: bold;
}

/* 价格区 */
.modal-price-box {
    display: flex;
    align-items: baseline;
    gap: 10px;
    background: #fdeceb;
    padding: 12px 14px;
    flex-wrap: wrap;
    border-radius: 3px;
}

.product-price {
    font-size: 26px;
    font-weight: bold;
    color: var(--jd-red);
}

.product-original-price {
    font-size: 13px;
    color: #b0b0b0;
    text-decoration: line-through;
}

.discount-tag {
    background: var(--jd-red);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: bold;
}

.modal-right .tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.modal-right .tags span {
    background: #fdeceb;
    color: var(--jd-red);
    padding: 2px 9px;
    border-radius: 2px;
    font-size: 12px;
}

/* 规格选择 */
.spec-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.spec-label {
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}

.spec-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.spec-option {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.spec-option:hover {
    border-color: var(--jd-red);
    color: var(--jd-red);
}

.spec-option.selected {
    border-color: var(--jd-red);
    color: var(--jd-red);
    background: #fdeceb;
    font-weight: bold;
}

/* 折叠式图文详情 */
.detail-desc {
    background: #fafafa;
    border-radius: 3px;
    padding: 10px 12px;
    border: 1px solid #f0f0f0;
}

.desc-text {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
    white-space: normal;
}

.desc-text.expanded {
    -webkit-line-clamp: unset;
}

.desc-toggle {
    margin-top: 6px;
    border: none;
    background: none;
    color: var(--jd-red);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.desc-toggle:hover {
    text-decoration: underline;
}

/* 服务保障 */
.service-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-light);
    background: #fafafa;
    border-radius: 3px;
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
}

.service-row .sep {
    color: #e0e0e0;
}

/* 数量选择 */
.modern-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-quantity .qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    font-size: 17px;
    font-weight: bold;
    color: #333;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.modern-quantity .qty-btn:hover {
    background: var(--bg-gray);
    border-color: #ccc;
}

input#productQuantity {
    width: 60px;
    text-align: center;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 6px 4px;
    outline: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.stock-hint {
    font-size: 12px;
    color: #e6a23c;
}

/* 弹窗操作区 */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.modern-btn {
    flex: 1;
    background: var(--jd-red);
    color: white;
    font-size: 15px;
    padding: 13px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.modern-btn:hover {
    background: var(--jd-dark-red);
}

.modern-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.fav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 20px;
    background: white;
    color: var(--text-dark);
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.fav-btn:hover {
    border-color: var(--jd-red);
    color: var(--jd-red);
}

.fav-btn.on {
    border-color: var(--jd-red);
    color: var(--jd-red);
    background: #fdeceb;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--text-weak);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    line-height: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--jd-red);
}

/* ==================== 结算弹窗 ==================== */
.checkout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.checkout-box {
    background: white;
    border-radius: 4px;
    width: 92%;
    max-width: 520px;
    max-height: 92%;
    overflow-y: auto;
    padding: 26px 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    animation: fadeIn 0.25s ease;
    position: relative;
}

.checkout-title {
    font-size: 18px;
    margin-bottom: 18px;
    text-align: center;
}

.checkout-summary {
    background: #fafafa;
    border-radius: 3px;
    padding: 12px 14px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #f0f0f0;
}

.co-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    padding: 6px 0;
    color: var(--text-dark);
    border-bottom: 1px dashed #eee;
}

.co-item:last-child {
    border-bottom: none;
}

.co-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.co-qty {
    color: var(--text-weak);
    flex-shrink: 0;
}

.co-price {
    font-weight: bold;
    flex-shrink: 0;
}

.checkout-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-top: 10px;
    color: var(--text-light);
}

.checkout-total-price {
    color: var(--jd-red);
    font-size: 22px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    border-color: var(--jd-red);
}

.pay-methods {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pay-method {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    position: relative;
}

.pay-method:has(input:checked) {
    border-color: var(--jd-red);
    background: #fdeceb;
    font-weight: bold;
}

.pay-method input {
    position: absolute;
    opacity: 0;
}

.pay-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pay-dot.wx { background: #22b14c; }
.pay-dot.ali { background: #1677ff; }
.pay-dot.bank { background: #e6a23c; }

.checkout-submit {
    width: 100%;
    padding: 12px;
    background: var(--jd-red);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.checkout-submit:hover {
    background: var(--jd-dark-red);
}

.checkout-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.checkout-submit.loading .submit-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.checkout-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-weak);
    margin-top: 10px;
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translate(-50%, -16px);
    background: rgba(0, 0, 0, 0.82);
    color: white;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 5000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.success {
    background: rgba(76, 175, 80, 0.95);
}

.toast.warn {
    background: rgba(230, 162, 60, 0.95);
}

.toast.error {
    background: rgba(225, 37, 27, 0.95);
}

.toast.info {
    background: rgba(0, 0, 0, 0.82);
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1200px) {
    .promo-section {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .floor-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .promo-banner {
        min-height: 200px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .category-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .search-box {
        order: 2;
        max-width: none;
    }

    .nav-actions {
        order: 1;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 顶部导航重排：第一行 [分类] logo 收藏 订单 [后台]，第二行搜索，第三行分类 */
    .nav-container {
        gap: 8px;
        padding: 0 10px;
    }

    .logo-text {
        display: none;
    }

    /* 类目展开按钮：与导航其他入口（收藏/订单）风格一致，透明无边框 */
    .toggle-side-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: auto;
        min-width: 64px;            /* 防止容器被挤压，保证 svg+文字放得下 */
        height: auto;
        padding: 7px 9px;
        background: transparent;
        border: none;
        color: white;
        border-radius: 3px;
        flex-shrink: 0;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;        /* 防止文字内换行 */
        -webkit-tap-highlight-color: transparent;
    }

    .toggle-side-nav:active {
        background: rgba(0, 0, 0, 0.15);
    }

    .toggle-side-nav .icon {
        width: 18px;
        height: 18px;
        color: white;
        flex-shrink: 0;
    }

    .toggle-side-nav-text {
        display: inline-block;
        line-height: 1;
        white-space: nowrap;
    }

    /* logo 紧跟分类按钮（不设 margin auto 避免与 nav-actions 推力冲突） */
    .logo {
        margin-right: 0;
    }

    /* 搜索框独占一行 */
    .search-box {
        order: 2;
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .category-nav {
        order: 3;
    }

    .nav-actions {
        order: 1;
        gap: 0;
        margin-left: 0;
    }

    .nav-action {
        padding: 6px 8px;
        font-size: 12px;
    }

    .nav-action-icon {
        font-size: 14px;
    }

    /* 管理后台入口移动端简化（短文字 + 小尺寸） */
    .admin-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .promo-section {
        grid-template-columns: 1fr;
        margin-top: 12px;
        padding: 0 10px;
    }

    .side-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        height: 100%;
        background: white;
        z-index: 2000;
        box-shadow: -2px 0 12px rgba(0, 0, 0, 0.18);
        padding: 20px;
        overflow-y: auto;
        border-radius: 0;
    }

    .side-nav.open {
        display: block;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-img-wrap {
        height: 150px;
    }

    .skeleton-card .card-img-wrap {
        height: 150px;
    }

    .floor-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
    }

    /* 商品详情弹窗移动端：全屏化，flex min-height:0 修复内容撑开 */
    .product-detail-modal {
        align-items: stretch;
    }

    .modal-content {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        overflow: hidden;
    }

    .modal-left {
        flex: 0 0 auto;
        padding: 10px;
        max-height: 220px;
        background: #fafafa;
    }

    .modal-left img {
        max-height: 200px;
    }

    .modal-right {
        flex: 1 1 auto;
        min-height: 0;          /* 关键：允许 flex 子项收缩并触发自身滚动 */
        overflow-y: auto;
        padding: 18px 18px 24px;
        -webkit-overflow-scrolling: touch;
    }

    /* 弹窗关闭按钮：右上角浮动，更大点击区 */
    .close-btn {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        z-index: 20;
    }

    .cart-items {
        width: 280px;
        right: -6px;
        max-height: 70vh;
    }

    .sticky-card {
        right: 8px;
        bottom: 8px;
        width: 52px;
        gap: 10px;
    }

    .sticky-card .card-item {
        min-height: 48px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .order-body {
        flex-direction: column;
    }

    .order-info {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #f0f0f0;
        padding-top: 10px;
    }

    /* 详情弹窗操作区：加购按钮 + 紧凑收藏按钮并排 */
    .modal-actions {
        flex-direction: row;
        gap: 8px;
    }

    .modern-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .fav-btn {
        flex: 0 0 64px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 8px 4px;
        font-size: 11px;
        border-radius: 3px;
    }

    .fav-btn .icon {
        width: 18px;
        height: 18px;
    }
}

@media (min-width: 769px) {
    .toggle-side-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .cart-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .cart-items {
        width: 290px;
        max-height: 380px;
    }
}
