/* ============================================================
   beqbg.cn 现代化美化层 (modern.css)
   叠加在 unicorn 主题之上，只做视觉覆盖，不改业务逻辑
   ============================================================ */

:root {
    --brand-1: #6366f1;
    --brand-2: #8b5cf6;
    --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --bg: #f5f6fa;
    --text: #1f2937;
    --text-light: #6b7280;
    --card-radius: 18px;
    --shadow-sm: 0 2px 10px rgba(17, 24, 39, .06);
    --shadow-lg: 0 14px 34px rgba(99, 102, 241, .16);
}

/* ---------- 全局 ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
    color: var(--text);
    background: var(--bg) !important;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, .10), transparent),
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, .07), transparent) !important;
    background-attachment: fixed !important;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(99, 102, 241, .25);
}

/* ---------- 顶部导航 ---------- */
.header.sticky-top {
    background: rgba(255, 255, 255, .82) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(17, 24, 39, .06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 20px rgba(17, 24, 39, .04);
}

.header .logo img {
    max-height: 56px;
    width: auto;
    border-radius: 12px;
    transition: transform .25s ease;
}

.header .logo img:hover {
    transform: scale(1.05);
}

.header .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    border-radius: 10px;
    padding: .45rem .95rem !important;
    margin: 0 2px;
    transition: all .2s ease;
}

.header .nav-link:hover {
    color: var(--brand-1) !important;
    background: rgba(99, 102, 241, .08);
}

.header .nav-link.active {
    color: #fff !important;
    background: var(--brand-grad);
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.header .form-control {
    border-radius: 999px !important;
    border: 1px solid rgba(17, 24, 39, .12);
    padding-left: 1rem;
    box-shadow: none;
}

.header .form-control:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.header .btn-secondary {
    border-radius: 999px !important;
    background: var(--brand-grad) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
    color: #fff;
}

.navbar-toggler {
    border-radius: 10px;
    border-color: rgba(17, 24, 39, .15);
}

/* ---------- 公告栏 ---------- */
.notice .card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    background: #fff;
}

.notice .card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--brand-grad);
}

.notice .card h4 {
    font-weight: 700;
    color: var(--brand-1);
}

.notice .card .lead {
    color: var(--text-light);
    margin-bottom: 0;
}

/* 公告为空时隐藏整个卡片 */
.notice .card:has(.lead:empty) {
    display: none;
}

/* ---------- 分类区标题 ---------- */
.category h3 {
    font-weight: 800 !important;
    letter-spacing: .5px;
    margin-top: 2rem;
    background: linear-gradient(135deg, #1f2937 30%, var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category .separator {
    width: 56px;
    height: 4px;
    border-radius: 4px;
    margin: 0.75rem auto 1rem;
    background: var(--brand-grad) !important;
}

.category .lead {
    color: var(--text-light) !important;
    font-size: 1rem !important;
}

/* 分类切换按钮 → 胶囊 */
.category-menus .btn-outline-secondary {
    border: 1px solid rgba(17, 24, 39, .12);
    color: var(--text-light);
    background: #fff;
    border-radius: 999px !important;
    padding: .45rem 1.25rem;
    margin: 4px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
}

.category-menus .btn-outline-secondary:hover {
    border-color: var(--brand-1);
    color: var(--brand-1);
    transform: translateY(-1px);
}

.category-menus .btn-outline-secondary.active {
    background: var(--brand-grad) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

/* ---------- 商品卡片 ---------- */
.goods-list .col {
    margin-bottom: .5rem;
}

.goods-list .card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #fff;
    transition: transform .28s ease, box-shadow .28s ease;
    height: 100%;
}

.goods-list .card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.goods-list .card-img-top {
    height: 170px;
    width: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    background: linear-gradient(135deg, #eef0ff, #f6f0ff);
}

.goods-list .card:hover .card-img-top {
    transform: scale(1.06);
}

.goods-list .card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.goods-list .card-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: .6rem;
}

/* 卡片上的角标 */
.goods-list .badge,
.buy-form .badge,
.sale .badge,
.good-card .badge {
    border-radius: 999px !important;
    font-weight: 600;
    padding: .4em .8em;
    box-shadow: 0 4px 10px rgba(17, 24, 39, .15);
}

.goods-list .badge.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.goods-list .badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316) !important;
    color: #fff !important;
}

/* 价格按钮 → 纯展示样式 */
.goods-list .btn-outline-success {
    border: none;
    background: none;
    color: #f43f5e !important;
    font-size: 1.05rem;
    padding: 0 .25rem 0 0;
    font-weight: 800;
}

.goods-list .btn-outline-success::before {
    content: "¥";
    font-size: .8em;
    margin-right: 1px;
}

.goods-list .btn-outline-warning {
    border: 1px solid rgba(245, 158, 11, .45);
    background: rgba(245, 158, 11, .08);
    color: #d97706;
    border-radius: 999px;
    font-size: .72rem;
    padding: .15rem .6rem;
}

.goods-list .text-muted {
    color: var(--text-light) !important;
    font-size: .82rem;
}

/* 立即购买按钮 */
.goods-list .btn-primary,
.good-card .btn-primary,
button[type="submit"].btn-primary,
.btn-primary {
    background: var(--brand-grad) !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(99, 102, 241, .3);
    transition: all .22s ease;
    color: #fff;
}

.goods-list .btn-primary {
    width: 100%;
    border-radius: 12px !important;
    margin-top: .55rem;
}

.goods-list .btn-primary:hover,
.good-card .btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, .42);
    filter: brightness(1.05);
}

.goods-list .fr {
    float: none !important;
}

/* ---------- 购买页 ---------- */
.good-card .card {
    border: none !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.good-card .card-title {
    font-weight: 800;
}

.good-card .card-img-top.p-5 {
    padding: 2rem !important;
    object-fit: contain;
}

.buy-form label {
    font-weight: 600;
    color: var(--text);
    font-size: .92rem;
}

.buy-form .form-control {
    border-radius: 12px !important;
    border: 1px solid rgba(17, 24, 39, .12);
    padding: .55rem .9rem;
    box-shadow: none;
    transition: all .2s ease;
}

.buy-form .form-control:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.buy-form .input-group {
    border-radius: 12px;
}

.buy-form button[type="submit"] {
    padding: .65rem 2.2rem;
    font-size: 1rem;
}

/* 支付方式列表 */
.list-group-item {
    border: none !important;
    border-bottom: 1px solid rgba(17, 24, 39, .06) !important;
    transition: background .15s ease;
}

.list-group-item:hover {
    background: rgba(99, 102, 241, .05);
}

.list-group-item.active {
    background: var(--brand-grad) !important;
    border-color: transparent !important;
}

/* ---------- 订单/查询页表格 ---------- */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: rgba(99, 102, 241, .07);
    color: var(--text);
    font-weight: 700;
    border-bottom: none;
}

/* ---------- 页脚 ---------- */
.footer {
    background: rgba(255, 255, 255, .6);
    border-top: 1px solid rgba(17, 24, 39, .06);
    color: var(--text-light);
    margin-top: 3rem;
}

.footer a {
    color: var(--brand-1);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .35);
    border-radius: 999px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .55);
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- 动效细节 ---------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.goods-list .col,
.notice .card,
.category {
    animation: fadeUp .5s ease both;
}

.goods-list .col:nth-child(2) { animation-delay: .05s; }
.goods-list .col:nth-child(3) { animation-delay: .1s; }
.goods-list .col:nth-child(4) { animation-delay: .15s; }
.goods-list .col:nth-child(5) { animation-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .goods-list .card-img-top {
        height: 130px;
    }

    .category h3 {
        font-size: 1.35rem;
        margin-top: 1.2rem;
    }

    .header .logo img {
        max-height: 44px;
    }

    .footer {
        margin-top: 2rem;
    }
}
