/**
 * 商业化页面外壳：首页 index 与工具页共用（页脚、版心等）。
 * index 专用栅格与组件亦在此文件，避免与 newBox 的 main.css 全局 body 冲突。
 */
html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
}

/* 首页根节点：字体与背景（避免覆盖 newBox 的 main.css body） */
.index-root {
    width: 100%;
    display: block;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(180deg, #f7f8fa 0%, #f0f2f5 40%, #f5f5f5 100%);
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

/* 版心：与 #big 同宽，保证统计区、筛选、栅格同一垂直轴线居中 */
.page-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* 首页首屏：C 端货架导购区 */
.index-hero.index-hero--shelf {
    display: block;
    padding: 8px 0 8px;
    margin-bottom: 4px;
}

.index-hero__shelf-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 8px;
}

.index-hero__titles {
    flex: 1;
    min-width: 200px;
}

.index-hero__title {
    margin: 0;
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.index-hero__lead {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.45;
    max-width: 520px;
}

.index-hero__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.index-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.index-search-bar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c8c8c' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.index-search-bar__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: #333;
}

.index-search-bar__input::placeholder {
    color: #bfbfbf;
}

.index-hero__stats {
    text-align: center;
    margin: 0;
    font-size: 12px;
    color: #8c8c8c;
    font-weight: 400;
}

.index-shelf-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #434343;
}

.btn-index-outline {
    color: #0095ff;
    padding: 8px 16px;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid #0095ff;
    border-radius: 6px;
    background: #fff;
    transition: background-color 0.2s, color 0.2s;
}

.btn-index-outline:hover {
    background: #e6f7ff;
    color: #007acc;
}

.btn-index-primary {
    background: #0095ff;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-index-primary:hover {
    background: #007acc;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 0 20px;
    padding: 0;
}

.filter-btn {
    padding: 7px 14px;
    background-color: #fff;
    color: #595959;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.filter-btn:hover {
    color: #ff5000;
    border-color: #ffb088;
    background-color: #fff7f0;
}

.filter-btn.is-active {
    color: #fff;
    background: linear-gradient(90deg, #ff6000 0%, #ff5000 100%);
    border-color: #ff5000;
    box-shadow: 0 2px 8px rgba(255, 80, 0, 0.35);
    font-weight: 600;
}

.filter-btn.is-active:hover {
    color: #fff;
    border-color: #ff5000;
    background: linear-gradient(90deg, #ff6a14 0%, #ff5514 100%);
}

.filter-btn.active {
    color: #fff;
    background: linear-gradient(90deg, #ff6000 0%, #ff5000 100%);
    border-color: #ff5000;
}

.title {
    text-align: center;
}

#big {
    width: 100%;
    margin: 12px 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    grid-gap: 15px;
    padding: 0;
}

.goodsItem {
    position: relative;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    min-height: 220px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    border-radius: 8px;
}

.goodsItem:hover {
    transform: translateY(-3px);
}

.goodsItem.catalog-card {
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.goodsItem.catalog-card:hover {
    box-shadow: 0 8px 24px rgba(255, 80, 0, 0.12);
    border-color: #ffe0cc;
}

.new-icon {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    height: 22px;
    min-width: 22px;
    padding: 0 7px;
    font-size: 11px;
    border-radius: 11px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    background: linear-gradient(135deg, #ff784e 0%, #ff5000 100%);
    box-shadow: 0 2px 6px rgba(255, 80, 0, 0.35);
}

.catalog-card-link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    min-height: 0;
    box-sizing: border-box;
}

.catalog-card__media {
    aspect-ratio: 1;
    width: 100%;
    max-height: 200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #f0f0f0;
}

.catalog-card-thumb,
.catalog-img {
    width: 100%;
    height: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 0;
}

.catalog-card__name {
    display: block;
    padding: 12px 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #262626;
    line-height: 1.35;
}

h3.title.catalog-card__name {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* 页脚：与 newBox 统一类名 */
.commerce-footer {
    text-align: center;
    padding: 20px 8px 28px;
    font-size: 12px;
    color: #8c8c8c;
    border-top: 1px solid #e8e8e8;
    margin-top: 8px;
}

.commerce-footer__addr {
    display: block;
    margin-bottom: 8px;
    color: #595959;
}

.commerce-footer__copy {
    display: block;
    margin-bottom: 10px;
    color: #8c8c8c;
}

.commerce-footer__links a {
    color: #1890ff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 12px;
}

.commerce-footer__links a:hover {
    text-decoration: underline;
}

/* 预留：历史浮动菜单样式（当前首页未使用 DOM，保留无妨） */
.menu {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background-color: rgba(245, 245, 245, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    width: 200px;
}

.menu.expanded {
    max-height: none;
    visibility: visible;
    opacity: 1;
}

.menu-item {
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #0095ff;
    color: #fff;
}

.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0095ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
}
