/* store.css */

:root {
    --hysteresis-curve: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.store-main-container {
    padding: 100px 24px 60px;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
}

.loading-text {
    text-align: center;
    font-size: 18px;
    color: var(--text-sub);
    margin-top: 20vh;
}

.store-header {
    margin-bottom: 40px;
    padding-top: 20px;
}

.store-header h1 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    background: var(--hero-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.store-header p {
    font-size: 18px;
    color: var(--text-sub);
    font-weight: 500;
}

.topic-section {
    margin-bottom: 50px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.7s var(--hysteresis-curve) forwards;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding: 0 4px;
}

.topic-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 为App组增加悬浮外盒保护层 */
.topic-scroller-wrapper {
    position: relative;
}

.app-grid-scroller {
    display: grid;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    grid-auto-columns: 88%;
    gap: 12px 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 40px 40px 60px 40px;
    margin: -40px -40px -60px -40px;
    scroll-padding-left: 40px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.app-grid-scroller::-webkit-scrollbar {
    display: none;
}

/* 引入非触屏的悬浮切换箭头样式 */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.scroll-arrow:hover {
    background: var(--glass-highlight);
    transform: translateY(-50%) scale(1.1);
}

.left-arrow { left: -24px; }
.right-arrow { right: -24px; }

@media (max-width: 768px) {
    .scroll-arrow { display: none !important; }
}

.app-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    scroll-snap-align: start;
    text-decoration: none;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s var(--hysteresis-curve), box-shadow 0.35s ease;
}

.app-list-item:hover {
    transform: scale(1.02) translateX(4px);
    box-shadow: var(--glass-hover-shadow);
}

.app-list-item:active {
    transform: scale(0.98);
}

.app-item-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 22.5%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: #fff;
}

.app-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-item-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item-desc {
    font-size: 13px;
    color: var(--text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4;
    margin-top: 2px;
}

.app-item-action {
    flex-shrink: 0;
}

.btn-get {
    background-color: transparent;
    box-shadow: inset 0 0 0 100px rgba(120, 120, 128, 0.12);
    background-image: var(--hero-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    font-size: 15px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.4s var(--hysteresis-curve);
}

[data-theme="dark"] .btn-get {
    box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.15);
}

.btn-get:hover {
    box-shadow: inset 0 0 0 100px rgba(120, 120, 128, 0.22);
    transform: scale(1.08);
}

[data-theme="dark"] .btn-get:hover {
    box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.25);
}

@media (min-width: 768px) {
    .app-grid-scroller {
        grid-auto-columns: calc(33.333% - 14px); 
    }
}

@media (max-width: 480px) {
    .topic-title { font-size: 18px; }
    .app-item-icon { width: 56px; height: 56px; }
    .app-item-name { font-size: 15px; }
}