/**
 * 应用中心 — 对齐 demo/src/app/pages/AppCenterPage.tsx
 * 商城插件首页 template/pc/demo/home/store/index.html 使用
 */

.demo-app-center {
    width: 100%;
    box-sizing: border-box;
    background: #f4f7fc;
    color: #0f172a;
}

/* 突破 app-container 限制，与 demo-product-page 一致 */
.demo-app-center--fullbleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    left: 0;
    right: 0;
}

.demo-app-center__inner {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .demo-app-center__inner {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ========== Hero ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.demo-app-hero {
    position: relative;
    padding-top: 80px;
    padding-bottom: 80px;
    background: #0a0f1c;
    overflow: hidden;
}

.demo-app-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    mix-blend-mode: luminosity;
}

.demo-app-hero__grad {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to right,
        #0a0f1c 0%,
        rgba(10, 15, 28, 0.8) 50%,
        rgba(30, 58, 138, 0.3) 100%
    );
}

.demo-app-hero__row {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
}

@media (min-width: 768px) {
    .demo-app-hero__row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.demo-app-hero__text {
    max-width: 36rem;
    text-align: center;
}

@media (min-width: 768px) {
    .demo-app-hero__text {
        text-align: left;
    }
}

.demo-app-hero__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .demo-app-hero__title-row {
        justify-content: flex-start;
    }
}

.demo-app-hero__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .demo-app-hero__title {
        font-size: 2.25rem;
    }
}

.demo-app-hero__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.2);
    backdrop-filter: blur(8px);
}

.demo-app-hero__lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 300;
    color: #d1d5db;
}

.demo-app-hero__search {
    width: 100%;
    max-width: 380px;
    flex-shrink: 0;
    align-self: center;
}

@media (min-width: 768px) {
    .demo-app-hero__search {
        align-self: auto;
    }
}

.demo-app-hero__search-wrap {
    position: relative;
}

.demo-app-hero__search-wrap .fa {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.demo-app-hero__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px 14px 44px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    backdrop-filter: blur(12px);
}

.demo-app-hero__input::placeholder {
    color: #9ca3af;
}

.demo-app-hero__input:hover {
    background: rgba(255, 255, 255, 0.1);
}

.demo-app-hero__input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* ========== Sticky filter ========== */
.demo-app-filter-bar {
    position: sticky;
    top: 64px;
    z-index: 30;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.demo-app-filter-bar__track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
}

.demo-app-filter-bar__track::-webkit-scrollbar {
    display: none;
}

.demo-app-filter {
    position: relative;
    flex-shrink: 0;
    padding: 8px 22px;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: color 0.2s;
    white-space: nowrap;
}

.demo-app-filter:hover {
    color: #0f172a;
    background: rgba(241, 245, 249, 0.9);
}

.demo-app-filter--active {
    color: #fff;
}

.demo-app-filter:not(.demo-app-filter--active) .demo-app-filter__pill {
    display: none !important;
}

.demo-app-filter--active .demo-app-filter__pill {
    display: block;
}

.demo-app-filter__pill {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #3b63f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
    z-index: 0;
}

.demo-app-filter__label {
    position: relative;
    z-index: 1;
}

/* ========== Main grid ========== */
.demo-app-main {
    padding-top: 40px;
    padding-bottom: 56px;
}

.demo-app-main__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.demo-app-main__h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.demo-app-main__count {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.demo-app-main__count strong {
    font-weight: 600;
    color: #0f172a;
}

.demo-app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .demo-app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .demo-app-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== Card ========== */
.demo-app-card.is-hidden {
    display: none !important;
}

.demo-app-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.35s;
}

.demo-app-card__link:hover {
    border-color: #bfdbfe;
    box-shadow: 0 16px 32px -12px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
}

.demo-app-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
    border-bottom: 1px solid #f8fafc;
    flex-shrink: 0;
}

.demo-app-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
    pointer-events: none;
}

.demo-app-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease-out;
}

.demo-app-card__link:hover .demo-app-card__media img {
    transform: scale(1.05);
}

.demo-app-card__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.demo-app-card__media--empty .fa {
    font-size: 48px;
    opacity: 0.5;
}

.demo-app-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    background: #fff;
}

.demo-app-card__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.demo-app-card__link:hover .demo-app-card__title {
    color: #2563eb;
}

.demo-app-card__desc {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.demo-app-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(241, 245, 249, 0.95);
}

.demo-app-card__price {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.demo-app-card__price-y {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.demo-app-card__price-num {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    letter-spacing: -0.02em;
}

.demo-app-card__price-unit {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 2px;
}

.demo-app-card__go {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #94a3b8;
    transition: background 0.3s, color 0.3s;
}

.demo-app-card__link:hover .demo-app-card__go {
    background: #2563eb;
    color: #fff;
}

.demo-app-card__go .fa {
    font-size: 12px;
}

/* Empty state（用 HTML hidden 属性控制显示） */
.demo-app-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 16px;
    color: #94a3b8;
    text-align: center;
}

.demo-app-empty[hidden] {
    display: none !important;
}

.demo-app-empty .fa {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.2;
}

.demo-app-empty p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
}
