/* ============================================
   易卡汇 - 主样式表 (style.css)
   ============================================ */

/* ----- 全局重置 & 基础变量 ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', Tahoma, Arial, sans-serif;
    background: #f2f5f9;
    color: #1a2a4a;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ----- 背景装饰 ----- */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, #f0f5fe, #e3eaf3);
    z-index: -1;
}

/* ============================================
   顶部导航 (header)
   ============================================ */
.header {
    background: #0f1f3a;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-box {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.header-brand img {
    height: 44px;
    width: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
}

.header-brand .info {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #eef3fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-actions .query-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.10);
    padding: 6px 18px;
    border-radius: 40px;
    color: #fff;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: 0.2s;
}

.header-actions .query-btn:hover {
    background: rgba(255, 255, 255, 0.20);
}

.header-actions .query-btn svg {
    fill: #fff;
    width: 18px;
    height: 18px;
}

/* ============================================
   主体容器
   ============================================ */
.main {
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

.main-box {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(3px);
    border-radius: 32px;
    padding: 28px 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* ============================================
   标题 & 公告区
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9eef4;
    margin-bottom: 24px;
}

.section-title svg {
    fill: #3b5bff;
    width: 24px;
    height: 24px;
}

.section-title span {
    font-size: 20px;
    font-weight: 600;
    color: #0f1f3a;
    letter-spacing: 0.3px;
}

.tips-card {
    background: #f8faff;
    border-radius: 24px;
    padding: 20px 24px;
    border: 1px solid #e6edf8;
    margin-bottom: 28px;
}

.tips-card h4 {
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tips-card p {
    margin: 10px 0;
    line-height: 1.7;
    color: #1f2f4a;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 18px 0 10px;
}

.btn-telegram {
    background: #fff;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    color: #3b5bff;
    box-shadow: 0 4px 14px rgba(59, 91, 255, 0.15);
    border: 1px solid rgba(59, 91, 255, 0.10);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(59, 91, 255, 0.20);
}

.btn-download {
    padding: 12px 32px;
    border-radius: 40px;
    font-weight: 600;
    color: #fff;
    border: none;
    display: inline-block;
    transition: 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-download.okx {
    background: linear-gradient(90deg, #4facfe, #00c6ff);
}

.btn-download.binance {
    background: linear-gradient(90deg, #43e97b, #38f9d7);
    color: #0f2a3a;
}

/* ============================================
   分类导航
   ============================================ */
.cate-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.cate-item {
    background: #edf3fd;
    padding: 8px 22px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    color: #1a2a4a;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.cate-item:hover {
    background: #dce6fe;
    border-color: #b8ccff;
}

.cate-item.active {
    background: #3b5bff;
    color: #fff;
    border-color: #3b5bff;
}

.cate-item.active .count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.cate-item .count-badge {
    background: rgba(59, 91, 255, 0.10);
    padding: 0 12px;
    border-radius: 30px;
    font-weight: 400;
    font-size: 13px;
    color: #3b5bff;
}

/* ============================================
   商品列表 (网格)
   ============================================ */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 6px;
}

.goods-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 16px 16px 18px;
    border: 1px solid #eaeff6;
    transition: 0.25s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.goods-card:hover {
    transform: translateY(-5px);
    border-color: #b8ccff;
    box-shadow: 0 16px 32px rgba(59, 91, 255, 0.06);
}

.goods-pic {
    width: 100%;
    height: 130px;
    background: #f4f8ff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.goods-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.goods-name {
    font-size: 16px;
    font-weight: 600;
    color: #0b1a30;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.goods-price {
    font-size: 22px;
    font-weight: 700;
    color: #2b4bff;
    margin: 6px 0 8px;
}

.goods-price small {
    font-size: 14px;
    font-weight: 400;
    color: #6a7f9e;
    margin-left: 4px;
}

.goods-price .original-price {
    font-size: 14px;
    font-weight: 400;
    color: #a0aec0;
    text-decoration: line-through;
    margin-left: 8px;
}

.stock-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.stock-bar .track {
    flex: 1;
    height: 6px;
    background: #e7ecf5;
    border-radius: 20px;
    overflow: hidden;
}

.stock-bar .track .fill {
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, #3b5bff, #7893ff);
    border-radius: 20px;
    transition: width 0.3s;
}

.stock-tag {
    font-size: 12px;
    color: #1f7b3e;
    background: #e1f3e8;
    padding: 2px 14px;
    border-radius: 40px;
    white-space: nowrap;
}

.stock-tag.low {
    color: #b45b1a;
    background: #fef0e0;
}

.stock-tag.out {
    color: #b02a37;
    background: #fce4e4;
}

.goods-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.goods-card.disabled:hover {
    transform: none;
    border-color: #eaeff6;
    box-shadow: none;
}

/* ============================================
   底部
   ============================================ */
.footer {
    background: #0f1f3a;
    padding: 28px 16px;
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer p {
    color: #95aac9;
    font-size: 14px;
}

.footer a {
    color: #a8c0f0;
}

/* ============================================
   移动端悬浮查询按钮
   ============================================ */
.query-float {
    position: fixed;
    bottom: 28px;
    right: 24px;
    background: #2b4bff;
    border-radius: 60px;
    padding: 10px 20px;
    box-shadow: 0 10px 32px rgba(43, 75, 255, 0.30);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    transition: 0.2s;
}

.query-float:hover {
    transform: scale(1.05);
    box-shadow: 0 14px 40px rgba(43, 75, 255, 0.40);
}

.query-float svg {
    fill: #fff;
    width: 22px;
    height: 22px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .header-box {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .header-brand .info {
        max-width: 100%;
        font-size: 15px;
        white-space: normal;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .main-box {
        padding: 18px 16px;
    }

    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .btn-group .btn-telegram {
        flex: 1 1 100%;
        justify-content: center;
    }

    .query-float {
        bottom: 16px;
        right: 16px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .tips-card {
        padding: 14px 16px;
    }

    .section-title span {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .goods-card {
        padding: 12px 12px 14px;
    }

    .goods-pic {
        height: 100px;
    }

    .goods-price {
        font-size: 18px;
    }

    .goods-name {
        font-size: 14px;
    }
}