/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft Yahei", sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    padding-bottom: 20px;
    padding-top: 20px; /* 顶部整体下移 */
}

/* 顶部背景区：适配所有设备 */
.top-bg {
    width: 100vw; /* 全屏宽度 */
    height: 200px;
    background: url('../images/gold-bg.jpg') no-repeat center;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
}
/* 黑色遮罩：调整为更透明，减少黑边感 */
.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25); /* 原为0.4，调亮 */
    z-index: 1;
}
.shop-header, .time-status {
    position: relative;
    z-index: 2;
}

/* Logo+店铺名样式 */
.shop-header {
    text-align: center;
    margin-bottom: 15px;
}
.shop-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
}
.shop-logo img {
    width: 100%;
    height: 100%;
}
.shop-name {
    font-size: clamp(20px, 4vw, 24px); /* 原为18px-22px，略微调大 */
    color: #fff;
    margin: 0;
}
/* 介绍文字：调大一点 */
.shop-desc {
    font-size: clamp(14px, 2vw, 16px); /* 原为12px-14px，调大 */
    color: #ccc;
    margin-top: 3px;
}

/* 实时时间+开盘按钮 */
.time-status {
    margin-top: 5px;
    text-align: center;
}
/* 时间文字：调大一点 */
.current-time {
    font-size: clamp(14px, 2vw, 16px); /* 原为12px-14px，调大 */
    color: #fff;
    margin-bottom: 8px;
}
/* 开盘/收盘按钮：调小一点 */
.market-status {
    background-color: #ff0000;
    color: #fff;
    border: none;
    padding: 6px 20px; /* 原为8px 25px，调小 */
    font-size: clamp(12px, 2vw, 14px); /* 原为14px-16px，调小 */
    border-radius: 3px;
    cursor: pointer;
}

/* 商品容器：Flexbox布局 */
.products-container {
    width: 100vw;
    margin: 10px 0 0 0;
    position: relative;
}

/* 固定表头 */
.table-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #000;
    display: flex;
    border-bottom: 1px solid #333;
}

/* 表头项 */
.header-item {
    flex: 1;
    color: #fff;
    font-size: clamp(12px, 2.5vw, 16px);
    padding: 10px 0;
    text-align: center;
    border-right: 1px solid #333;
}

.header-item:last-child {
    border-right: none;
}

/* 商品列表容器 */
.products-list {
    display: flex;
    flex-direction: column;
}

/* 商品行 - 动态高度 */
.product-row {
    display: flex;
    border-bottom: 1px solid #333;
    min-height: 44px; /* 最小高度，而不是固定高度 */
    height: auto; /* 高度自适应内容 */
}

.product-row:nth-child(odd) {
    background-color: #222;
}

.product-row:nth-child(even) {
    background-color: #000;
}

/* 商品单元格 - 允许内容撑开高度 */
.product-cell {
    flex: 1;
    font-size: clamp(11px, 2.2vw, 15px);
    padding: 8px 0; /* 减少固定padding，让内容决定高度 */
    text-align: center;
    border-right: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* 设置最小高度 */
}

.product-cell:last-child {
    border-right: none;
}

/* 价格颜色 */
.price-up { color: #ff0000 !important; }
.price-down { color: #00ff00 !important; }
.product-name-yellow { 
    color: #ffff00 !important; 
    font-weight: bold; 
    text-align: center !important; /* 确保居中 */
}

/* 高低列单元格 */
.high-low-cell {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.4; /* 增加行高，让内容有更多空间 */
    padding: 6px 0; /* 调整padding */
}

/* 高低列内部容器 - 调整数字大小 */
.high-low {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: clamp(12px, 2.2vw, 14px); /* 调整数字大小 */
    gap: 2px; /* 增加两个数字之间的间距 */
}

/* 无数据提示 */
.no-data {
    padding: 20px;
    text-align: center;
    color: #ccc;
    background-color: #222;
}

/* 底部信息：自适应 */
.footer-section {
    padding: 20px 15px;
    background-color: #000;
    text-align: center;
    font-size: clamp(12px, 2vw, 14px);
    margin-top: 15px;
}

/* 联系方式 */
.contact-info {
    margin-bottom: 20px;
}

.contact-item {
    margin-bottom: 10px;
    font-size: 14px;
}

.contact-item strong {
    color: #ffff00;
    margin-right: 10px;
}

/* 二维码区域 */
.qrcode-section {
    margin-bottom: 20px;
}

.qrcode {
    text-align: center;
}

.qrcode img {
    width: 150px;
    height: 150px;
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.qrcode p {
    font-size: 14px;
    color: #ccc;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #999;
    font-size: 14px;
}

/* 响应式调整：确保在移动设备上显示4列 */
@media (max-width: 768px) {
    .product-cell, .header-item {
        min-width: 0; /* 允许flex项缩小 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 商品名称特殊处理 */
    .product-name-yellow {
        font-size: clamp(11px, 2.5vw, 14px);
    }
}

/* 对于非常小的屏幕（小于400px） */
@media (max-width: 400px) {
    .product-cell, .header-item {
        padding: 6px 0;
        font-size: 11px;
    }
    
    .high-low {
        font-size: 11px; /* 确保小屏幕上也有合适的字体大小 */
    }
    
    .shop-name {
        font-size: clamp(18px, 4vw, 22px);
    }
    
    .shop-desc {
        font-size: clamp(12px, 2vw, 14px);
    }
    
    .current-time {
        font-size: clamp(12px, 2vw, 14px);
    }
    
    .market-status {
        padding: 5px 15px;
        font-size: clamp(11px, 2vw, 13px);
    }
}