* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f0c29;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    touch-action: manipulation;
}

.header {
    padding: 12px 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.title {
    font-size: 20px;
    font-weight: 600;
    color: #ff7eb9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ===== 新增：滑动容器 ===== */
.category-scroller {
    width: 100%;
    height: 56px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
}
.category-scroller::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ===== 修改：内部分类栏 ===== */
.category-bar {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    gap: 12px;
    white-space: nowrap;
}

.category-btn {
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ddd;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    scroll-snap-align: center;
    flex-shrink: 0; /* 关键：禁止压缩 */
    min-width: 70px;
    text-align: center;
}
.category-btn.active {
    background: linear-gradient(135deg, #ff7eb9, #ff6b6b);
    color: white;
    border-color: transparent;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    position: relative;
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(90px);
    background-color: rgba(255, 255, 255, 0.03);
}

.image-wrapper {
    width: 92%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    aspect-ratio: auto;
}

#cos-image {
    width: 100%;
    height: auto;
    display: none;
    object-fit: contain;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff7eb9;
}

.spinner {
    width: 32px;
    height: 32px;
    animation: spin 1.2s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
}

.retry-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff7eb9;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: none;
    border: none;
    font-size: 14px;
}