* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg-body);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--brown-dark);
    -webkit-font-smoothing: antialiased;
}

.home-page {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-page);
    padding-bottom: 0;
}

/* Banner */
.home-banner {
    position: relative;
    overflow: hidden;
}

.home-banner .swiper-slide {
    position: relative;
    height: 200px;
}

.home-banner .banner-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.home-banner .banner-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.home-banner .banner-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0.5) 100%);
}

.home-banner .banner-text {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 28px;
    z-index: 2;
    pointer-events: none;
}

.home-banner.is-single .banner-text {
    bottom: 16px;
}

.home-banner .banner-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #f3d89a;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.home-banner .banner-subtitle {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(240, 215, 168, 0.92);
    letter-spacing: 0;
}

.home-banner .swiper-pagination {
    bottom: 10px !important;
}

.home-banner.is-single .swiper-pagination {
    display: none;
}

.home-banner .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.home-banner .swiper-pagination-bullet-active {
    width: 14px;
    border-radius: 4px;
    background: #fff;
}

/* Categories */
.home-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 14px 12px 6px;
}

.cat-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cat-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(74, 52, 40, 0.08);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cat-icon .cat-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8d5c4, #c9a063);
}

.cat-item span {
    font-size: 13px;
    color: var(--brown-dark);
}

/* Feature grid */
.home-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "rwa auction"
        "rwa latest";
    gap: 8px;
    padding: 8px 12px;
}

.feature-card {
    position: relative;
    min-height: 88px;
    border-radius: var(--radius);
    background: #fff center / cover no-repeat;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(74, 52, 40, 0.06);
}

.feature-card.has-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
}

.feature-card.feature-rwa.has-bg,
.feature-card.feature-auction.has-bg,
.feature-card.feature-latest.has-bg {
    background-color: #14110e;
    background-position: right center;
    background-size: auto 100%;
    background-repeat: no-repeat;
}

.feature-card.feature-rwa.has-bg::before {
    background: linear-gradient(
        90deg,
        rgba(20, 17, 14, 0.94) 0%,
        rgba(20, 17, 14, 0.82) 38%,
        rgba(20, 17, 14, 0.35) 58%,
        transparent 72%
    );
}

.feature-card.feature-auction.has-bg::before {
    background: linear-gradient(
        90deg,
        rgba(20, 17, 14, 0.94) 0%,
        rgba(20, 17, 14, 0.78) 42%,
        rgba(20, 17, 14, 0.3) 62%,
        transparent 78%
    );
}

.feature-card.feature-latest.has-bg::before {
    background: linear-gradient(
        90deg,
        rgba(20, 17, 14, 0.94) 0%,
        rgba(20, 17, 14, 0.78) 42%,
        rgba(20, 17, 14, 0.3) 62%,
        transparent 78%
    );
}

.feature-card.feature-auction:not(.has-bg),
.feature-card.feature-latest:not(.has-bg) {
    background: linear-gradient(145deg, #2c2620 0%, #1a1612 55%, #12100e 100%);
    border: 1px solid rgba(201, 169, 98, 0.22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.feature-card.feature-auction:not(.has-bg)::after,
.feature-card.feature-latest:not(.has-bg)::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 88% 50%, rgba(201, 169, 98, 0.12) 0%, transparent 42%),
        linear-gradient(135deg, transparent 60%, rgba(201, 169, 98, 0.06) 100%);
    pointer-events: none;
}

.feature-card-body {
    position: relative;
    z-index: 1;
    padding: 12px;
    height: 100%;
}

a.feature-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.feature-card.feature-rwa {
    grid-area: rwa;
    min-height: 184px;
}

.feature-card.feature-auction {
    grid-area: auction;
}

.feature-card.feature-latest {
    grid-area: latest;
}

.feature-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--brown-dark);
}

.feature-card p {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 70%;
    white-space: pre-line;
}

.feature-card.feature-rwa.has-bg h3,
.feature-card.feature-auction.has-bg h3,
.feature-card.feature-latest.has-bg h3,
.feature-card.feature-auction:not(.has-bg) h3,
.feature-card.feature-latest:not(.has-bg) h3 {
    color: #f0e6d8;
}

.feature-card.feature-rwa.has-bg p,
.feature-card.feature-auction.has-bg p,
.feature-card.feature-latest.has-bg p,
.feature-card.feature-auction:not(.has-bg) p,
.feature-card.feature-latest:not(.has-bg) p {
    color: rgba(240, 230, 216, 0.82);
    max-width: 62%;
}

/* Section title */
.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 12px 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--brown-dark);
}

.section-title::before,
.section-title::after {
    content: "";
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brown-light), transparent);
}

/* Auction preview */
.preview-list {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(74, 52, 40, 0.06);
    text-decoration: none;
    color: inherit;
}

.preview-card.reverse {
    flex-direction: row-reverse;
}

.preview-frame {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(145deg, #f3e6d5, #d4b896);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.preview-frame img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.preview-info h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preview-price {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-price strong {
    display: block;
    margin-top: 2px;
    font-size: 20px;
    color: var(--price-red);
    font-weight: 700;
}

.preview-heat {
    margin-top: 8px;
    font-size: 12px;
    color: var(--brown-light);
}

/* Tabs */
.home-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 12px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.home-tabs::-webkit-scrollbar {
    display: none;
}

.home-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #fff;
    color: var(--brown-mid);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.home-tab.active {
    background: var(--brown-dark);
    color: #fff;
    font-weight: 600;
}

/* Goods grid */
.goods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px;
}

.goods-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(74, 52, 40, 0.06);
    position: relative;
}

.goods-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.goods-card .goods-img-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg-muted);
}

.goods-card .goods-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.goods-card .goods-body {
    padding: 10px 10px 12px;
}

.goods-card .goods-tag {
    display: inline-block;
    margin-bottom: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f6e8d8;
    color: #a66b2a;
    font-size: 10px;
}

.goods-card h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    height: calc(1.35em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.goods-views {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.4;
}

.goods-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.goods-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--price-red);
}

.goods-price small {
    font-size: 11px;
    font-weight: 400;
}

.goods-price-empty,
.preview-price .price-empty {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.goods-price-empty {
    font-size: 12px;
}

.goods-origin {
    font-size: 11px;
    color: #bbb;
    text-decoration: line-through;
}

.goods-add {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--brown-dark);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(74, 52, 40, 0.25);
}
