/* ================= 首页 ================= */

/* 顶部渐变弧形背景 */
.home-top-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: var(--color-primary-gradient);
    border-radius: 0 0 30% 30%;
    z-index: 0;
}

.home-header {
    background: transparent;
    position: relative;
    z-index: 2;
    padding-top: 18px;
    height: 44px;
}

.home-header .header-left {
    color: var(--color-white);
    font-size: var(--font-size-lg);
    font-weight: 700;
    width: auto;
    padding-left: 5px;
}

.home-header .header-right {
    color: var(--color-white);
    width: auto;
}

.search-bar {
    background-color: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    max-width: 50%;
    margin-left: auto;
}

.search-bar .search-icon {
    font-size: 12px;
    margin-right: 3px;
}

.search-bar input {
    color: var(--color-black);
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--font-size-xs);
}

.search-bar input::placeholder {
    color: #AAA;
}

.home-tabs {
    background: transparent;
    padding: 22px var(--spacing-md) 16px;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
}

.home-tabs .tab {
    color: rgba(255, 255, 255, 0.78);
    font-size: var(--font-size-sm);
    padding: 4px 12px;
    border-radius: 100px;
    transition: all 0.2s;
}

.home-tabs .tab.active {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
}

.home-tabs .tab.active::after {
    display: none; /* 用背景替代下划线 */
}

/* 内容滚动区域 */
.content-wrapper {
    position: relative;
    z-index: 2;
    padding-top: 8px;
}

/* 订单通知条 */
.order-banner {
    background-color: var(--color-secondary);
    padding: 10px 16px;
    display: none;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    margin: 0 var(--spacing-md) var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

/* ---------- 授信额度卡片 ---------- */
.credit-card {
    background: var(--color-secondary-gradient);
    margin: 0 var(--spacing-md) var(--spacing-md);
    padding: 20px 18px;
    border-radius: var(--radius-xl);
    position: relative;
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.credit-tags {
    margin-bottom: 10px;
}

.credit-title {
    font-size: var(--font-size-xs);
    color: var(--color-gold-text);
    font-weight: 500;
}

.credit-amount .amount {
    font-size: 34px;
    font-weight: 800;
    color: var(--color-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.1;
    margin: 2px 0;
}

.credit-sub {
    font-size: var(--font-size-xs);
    color: var(--color-gold-text);
    opacity: 0.7;
}

.credit-slogan {
    font-size: var(--font-size-xs);
    color: rgba(140, 94, 0, 0.5);
    margin-top: 8px;
}

.btn-credit {
    position: absolute;
    right: 16px;
    bottom: 20px;
    background: var(--color-primary-gradient);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(230, 33, 42, 0.3);
}

.btn-buy {
    background: var(--color-primary-gradient);
    color: var(--color-white);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(230, 33, 42, 0.3);
    white-space: nowrap;
}

/* ---------- 金刚区 ---------- */
.quick-links {
    display: flex;
    justify-content: space-around;
    padding: 18px 12px;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    margin: 0 var(--spacing-md) var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--font-size-xs);
    width: 20%;
    transition: transform 0.15s;
}

.link-item:active { transform: scale(0.92); }

/* ---------- Banner 轮播 ---------- */
.banner-carousel {
    margin: 0 var(--spacing-md) var(--spacing-md);
}

.banner-slide {
    height: 110px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-lg);
    letter-spacing: 1px;
    overflow: hidden;
}

/* ---------- 限时特惠 ---------- */
.flash-sale {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin: 0 var(--spacing-md) var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.sale-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.sale-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-title);
}

.countdown {
    background: var(--color-primary-gradient);
    color: var(--color-white);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-left: 10px;
}

.more-link {
    margin-left: auto;
    color: var(--color-gray);
    font-size: var(--font-size-xs);
}

.sale-list {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
}

.product-card {
    width: 130px;
    flex-shrink: 0;
}

.product-card .product-img {
    height: 130px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.product-price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-md);
}

.product-title {
    font-size: var(--font-size-xs);
    color: var(--color-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 猜你喜欢 (双列瀑布流) ---------- */
.recommend-section {
    padding: 0 var(--spacing-md) 80px;
}

.section-title {
    text-align: center;
    margin: 24px 0 16px;
}

.section-title span {
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.grid-item {
    width: calc(50% - 5px);
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.grid-img {
    width: 100%;
    height: 160px;
}

.grid-info {
    padding: 10px;
}

.grid-title {
    font-size: var(--font-size-xs);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--color-title);
    margin-bottom: 4px;
}

.grid-tags {
    margin-bottom: 6px;
}

.grid-price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-md);
}

/* 占位图辅助 */
.bg-gold-gradient { background: var(--grad-gold); }
.bg-gradient-purple { background: var(--grad-purple); }
.bg-gradient-orange { background: var(--grad-orange); }
.bg-gradient-red { background: var(--grad-red); }
.bg-gradient-blue { background: var(--grad-blue); }
.bg-blue-light { background-color: #E8F3FF; }
.bg-pink-light { background-color: #FFF0F5; }
.bg-gold-light { background-color: #FFF6E5; }
.bg-gray-light { background-color: #F5F5F5; }

.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* 产品图片 */
.product-img {
    width: 100%;
    height: 130px;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-bottom: 6px;
}

.product-img-fallback {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    font-size: 48px;
}

.product-img-placeholder {
    width: 100%;
    height: 130px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

/* 商品详情大图 */
.gallery-img {
    width: 100%;
    height: 375px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

/* 订单/弹窗缩略图 */
.order-product-thumb,
.modal-product-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 协议详情弹窗 */
.modal-agreement-content {
    max-height: 80vh;
}

.modal-agreement-body {
    flex: 1;
    overflow-y: auto;
}

.agreement-text {
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--color-gray);
    font-size: var(--font-size-sm);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }

/* 底部导航栏 */
.bottom-nav-spacer { height: 64px; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 480px;
    display: flex;
    background-color: var(--color-white);
    padding: 6px 0;
    z-index: 90;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}

.rounded-top { border-radius: 20px 20px 0 0; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

.nav-item.active { color: var(--color-primary); }

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* ================= 商品详情页 ================= */
.detail-tabs {
    display: flex;
    gap: 20px;
}

.detail-tabs .tab {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-md);
}

.detail-tabs .tab.active {
    color: var(--color-white);
    font-weight: 600;
}

.detail-tabs .tab.active::after {
    content: '';
    display: block;
    width: 16px;
    height: 3px;
    background: var(--color-white);
    border-radius: 2px;
    margin: 4px auto 0;
}

.product-gallery {
    width: 100%;
    height: 375px;
}

.product-gallery-placeholder {
    width: 100%;
    height: 100%;
    font-size: 120px;
}

.product-info-panel {
    background-color: var(--color-white);
    padding: 16px;
    margin-top: -8px;
    border-radius: 16px 16px 0 0;
    position: relative;
    z-index: 2;
}

.price-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.price-row .price {
    font-size: var(--font-size-xxl);
    font-weight: 800;
    margin-right: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

.product-fullname {
    font-size: var(--font-size-lg);
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-title);
    margin-bottom: 4px;
}

.product-shortname {
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    margin-bottom: 10px;
}

/* 详情页标签内容 */
.detail-tab-content {
    display: none;
    background-color: var(--color-white);
    margin-bottom: 80px;
}

.detail-tab-content.active {
    display: block;
}

.product-highlights {
    background-color: var(--color-white);
    padding: 16px 16px 0;
}

.product-highlights h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-title);
}

.product-highlights ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-highlights li {
    background: var(--color-bg);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

/* 规格参数 */
.product-specs {
    padding: 16px;
    background-color: var(--color-white);
}

.product-specs h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-title);
}

.spec-table {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.spec-row {
    display: flex;
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.spec-row:last-child { border-bottom: none; }

.spec-label {
    color: var(--color-gray);
    width: 60px;
    flex-shrink: 0;
}

.spec-value {
    color: var(--color-title);
    font-weight: 500;
}

/* 商品描述 */
.product-description {
    padding: 16px;
    background-color: var(--color-white);
}

.product-description h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-title);
}

.product-description p {
    font-size: var(--font-size-sm);
    line-height: 1.8;
    color: var(--color-black);
    margin-bottom: 10px;
}

.product-description p:last-child { margin-bottom: 0; }

/* 品质承诺列表 */
.quality-list {
    list-style: none;
    padding: 0 16px 16px;
    background-color: var(--color-white);
}

.quality-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-title);
    line-height: 1.6;
}

.quality-list li:last-child { border-bottom: none; }

/* 购物指南 */
.help-section {
    padding: 16px;
    background-color: var(--color-white);
}

.help-section h3 {
    font-size: var(--font-size-md);
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--color-title);
}

.help-item {
    margin-bottom: 16px;
}

.help-item:last-child { margin-bottom: 0; }

.help-item h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-title);
    margin-bottom: 4px;
}

.help-item p {
    font-size: var(--font-size-xs);
    color: var(--color-gray);
    line-height: 1.7;
}

.action-icons {
    display: flex;
    gap: 16px;
    margin-right: 12px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

.icon-item.active { color: var(--color-primary); }

/* ================= 确认订单页 & 订单详情页 ================= */
.address-card {
    background-color: var(--color-white);
    padding: 16px;
    margin: 10px var(--spacing-md);
    border-radius: var(--radius-md);
}

.user-info {
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin-bottom: 6px;
    color: var(--color-title);
}

.user-info .phone {
    font-size: var(--font-size-md);
    color: var(--color-gray);
    margin-left: 8px;
    font-weight: 400;
}

.address-detail {
    font-size: var(--font-size-sm);
    color: var(--color-black);
}

.order-product-card {
    background-color: var(--color-white);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    margin: 0 var(--spacing-md) var(--spacing-sm);
    border-radius: var(--radius-md);
}

.product-desc {
    margin-left: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-desc h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-title);
    margin-bottom: 4px;
}

.product-desc .spec {
    font-size: var(--font-size-xs);
    color: var(--color-gray);
    background-color: var(--color-bg);
    padding: 2px 8px;
    border-radius: 100px;
    align-self: flex-start;
    margin-bottom: 6px;
}

.price-qty {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price-qty .price {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.warning-banner {
    background-color: var(--color-secondary);
    color: #D48600;
    padding: 10px 16px;
    font-size: var(--font-size-xs);
    margin: 0 var(--spacing-md) var(--spacing-sm);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fee-details {
    background-color: var(--color-white);
    padding: 0 16px;
    margin: 0 var(--spacing-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.fee-row:last-child { border-bottom: none; }

.fee-row input {
    text-align: right;
    font-size: var(--font-size-sm);
    color: var(--color-black);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.total-row {
    background-color: var(--color-white);
    padding: 14px 16px;
    text-align: right;
    font-size: var(--font-size-sm);
    margin: 10px var(--spacing-md) 130px;
    border-radius: var(--radius-md);
}

.price-large {
    font-size: var(--font-size-xl);
    font-weight: 800;
}

/* 订单状态横幅 */
.status-banner {
    padding: 24px 16px;
    text-align: center;
    margin: 0 var(--spacing-md);
    border-radius: var(--radius-md);
}

.status-banner h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 6px;
}

.status-banner p {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

/* ================= 协议签署页 ================= */
.agreement-list {
    margin: 10px var(--spacing-md);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.agreement-item {
    padding: 15px 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-md);
    background: var(--color-white);
    color: var(--color-title);
}

.agreement-item:last-child { border-bottom: none; }

/* ================= 弹窗内部 ================= */
.modal-product {
    display: flex;
    align-items: flex-end;
}

.modal-product .info {
    margin-left: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.modal-product .price {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.modal-product .selected-sku {
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

.section {
    margin-bottom: 18px;
}

.section h4 {
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-title);
}

.sku-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sku-tags .tag {
    padding: 8px 14px;
    background-color: var(--color-bg);
    color: var(--color-black);
    font-size: var(--font-size-sm);
    border-radius: 100px;
    border: 1.5px solid transparent;
}

.sku-tags .tag.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pay-option {
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pay-option.active {
    border-color: var(--color-primary);
    background-color: rgba(230, 33, 42, 0.03);
}

.option-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-desc {
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

/* 分期计划 */
.rate-notice {
    background: var(--color-secondary);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.plan-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.plan-item:last-child { border-bottom: none; }

.plan-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.plan-total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
}

/* 签名区 */
.signature-box {
    background-color: var(--color-bg);
    padding: 14px;
    border-radius: var(--radius-md);
}