/* ========================================
   App Plaza - Modern Visual Design
   左栏导航 + 右栏主内容布局
   ======================================== */

:root {
    --apple-blue: #0071E3;
    --apple-blue-hover: #0077ED;
    --apple-blue-light: rgba(0, 113, 227, 0.08);
    --apple-gray: #86868B;
    --apple-gray-2: #AEAEB2;
    --apple-gray-3: #C7C7CC;
    --apple-gray-4: #D1D1D6;
    --apple-gray-5: #E5E5EA;
    --apple-gray-6: #F2F2F7;
    --apple-separator: rgba(60, 60, 67, 0.06);
    --apple-separator-bold: rgba(60, 60, 67, 0.10);

    /* 主色调 - 明亮友好的蓝色，与 Header 深蓝协调但更活泼 */
    --nav-blue: #2563EB;
    --nav-blue-dark: #1D4ED8;
    --nav-blue-hover: #3B82F6;
    --nav-blue-light: rgba(37, 99, 235, 0.08);
    /* Header 金色 */
    --header-gold: #edae24;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-sidebar: #FAF9F6;
    --bg-card: #FFFFFF;
    --text-primary: #2D2D2F;
    --text-secondary: #6E6E73;
    --text-tertiary: #9A9A9F;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.03);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
    --shadow-banner: 0 6px 28px rgba(0,0,0,0.10);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --sidebar-width: 210px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background: #FFFFFF;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
    background: var(--bg-sidebar);
}

/* 覆盖 cx-header-ui 的背景，与左侧导航栏保持一致 */
#header .shared-header,
#header > div {
    background: var(--bg-sidebar) !important;
    background-color: var(--bg-sidebar) !important;
    border-bottom: 1px solid var(--apple-separator-bold);
}

#header .shared-header .header-logo .tit {
    color: var(--text-primary) !important;
}

/* 覆盖 Header 组件库的黄色背景为白色 */
.shared-header {
    background-color: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ========================================
   Plaza Container - Sidebar + Main Layout
   ======================================== */
.plaza-container {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 56px);
}

/* ========================================
   Search Box - Mac App Store Style
   ======================================== */
.plaza-nav-top-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plaza-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    transition: all var(--transition-fast);
    border: 1.5px solid transparent;
}

.plaza-search-box:focus-within {
    background: #fff;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.plaza-search-icon {
    flex-shrink: 0;
    color: var(--apple-gray);
    display: flex;
    align-items: center;
    line-height: 1;
}

.plaza-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 0;
    line-height: 1.4;
}

.plaza-search-input::placeholder {
    color: var(--apple-gray-2);
}

.plaza-search-clear-btn {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: none;
    background: none;
    color: var(--apple-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: color var(--transition-fast);
}

.plaza-search-clear-btn:hover {
    color: var(--text-secondary);
}

/* ========================================
   Create Button - Apple Style
   ======================================== */
.plaza-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 18px;
    margin-bottom: 16px;
    border: none;
    border-radius: 980px;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25), 0 1px 3px rgba(37, 99, 235, 0.15);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.plaza-create-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.plaza-create-btn:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
}

.plaza-create-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

.plaza-create-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.plaza-create-btn-text {
    line-height: 1;
}

/* Search results header */
.plaza-search-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 4px 0 8px;
}

.plaza-search-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.plaza-search-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plaza-filter-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--apple-blue);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: opacity var(--transition-fast);
    font-family: inherit;
}

.plaza-filter-toggle:hover { opacity: 0.7; }

.plaza-filter-toggle .filter-arrow {
    font-size: 10px;
    transition: transform var(--transition-fast);
    margin-top: 1px;
}

.plaza-filter-toggle.active .filter-arrow {
    /* arrow direction handled via text content toggle */
}

/* Filter Panel - Apple App Store Style */
.plaza-filter-panel {
    display: none;
    padding: 24px 0 20px;
    margin-bottom: 24px;
    animation: filterSlideDown 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.plaza-filter-panel.open {
    display: block;
}

@keyframes filterSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.plaza-filter-row {
    display: flex;
    gap: 56px;
    flex-wrap: wrap;
}

.plaza-filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 100px;
}

.plaza-filter-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0;
    text-transform: none;
    padding-bottom: 2px;
}

.plaza-filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plaza-filter-option {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 3px 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition-fast);
    text-align: left;
    line-height: 1.4;
    position: relative;
}

.plaza-filter-option:hover {
    color: var(--apple-blue);
}

.plaza-filter-option.active {
    color: var(--apple-blue);
    font-weight: 600;
}

.plaza-filter-option .filter-check {
    width: 18px;
    font-size: 14px;
    color: var(--apple-blue);
    flex-shrink: 0;
    visibility: hidden;
    margin-right: 2px;
}

.plaza-filter-option.active .filter-check {
    visibility: visible;
}

/* ========================================
   Left Sidebar - Refined Nav
   ======================================== */
.plaza-category-nav {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    background: var(--bg-sidebar);
    border-right: none;
    border-radius: 0 16px 16px 0;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.06), 1px 0 4px rgba(0, 0, 0, 0.03);
    padding: 20px 14px;
    z-index: 1;
}

.plaza-category-nav::-webkit-scrollbar { width: 0; }

.plaza-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plaza-category-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    white-space: nowrap;
    border: none;
    background: transparent;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.plaza-category-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.plaza-category-item.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--nav-blue);
    font-weight: 600;
    box-shadow: none;
}

.plaza-category-item .category-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    filter: grayscale(1);
    opacity: 0.45;
    transition: all var(--transition-fast);
}

.plaza-category-item.active .category-icon {
    filter: grayscale(0);
    opacity: 1;
}

.plaza-category-item .category-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.plaza-category-error {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.plaza-category-error .retry-btn {
    margin-top: 10px;
    padding: 6px 18px;
    background: var(--nav-blue);
    color: #fff;
    border: none;
    border-radius: 980px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.plaza-category-error .retry-btn:hover { opacity: 0.8; }

/* ========================================
   Main Content Area
   ======================================== */
.plaza-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 36px 80px;
    background: var(--bg-primary);
}

/* ========================================
   Banner Carousel
   ======================================== */
.plaza-banner {
    position: relative;
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-banner);
}

.plaza-banner:empty { display: none; }

.banner-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.banner-item {
    flex: 0 0 100%;
    position: relative;
    aspect-ratio: 1580 / 436;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.banner-item:hover img {
    transform: scale(1.02);
}

.banner-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 32px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.55) 100%);
    color: #fff;
}

.banner-item-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
    line-height: 1.2;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.banner-item-desc {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 6px;
    font-weight: 400;
}

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: all var(--transition-fast);
    z-index: 2;
    opacity: 0;
}

.plaza-banner:hover .banner-arrow { opacity: 1; }

.banner-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}

.banner-arrow-prev { left: 14px; }
.banner-arrow-next { right: 14px; }

.banner-indicators {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 2;
}

.banner-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.banner-indicator.active {
    background: #fff;
    width: 22px;
    border-radius: 4px;
}

/* ========================================
   Category Section
   ======================================== */
.category-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--apple-separator-bold);
}

.category-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.category-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.category-section-viewall {
    font-size: 16px;
    font-weight: 500;
    color: var(--apple-blue);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 0;
    transition: opacity var(--transition-fast);
}

.category-section-viewall:hover { opacity: 0.7; }

.category-section-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ========================================
   App Card - Soft Neumorphic Card Design
   内嵌预览图 + 标题 + 浏览量/作者/箭头
   ======================================== */
.app-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    background: #f0f2f5;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 6px 6px 12px rgba(0,0,0,0.06), -4px -4px 10px rgba(255,255,255,0.8);
    min-width: 0;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 14px 14px 10px;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 18px rgba(0,0,0,0.09), -4px -4px 12px rgba(255,255,255,0.9);
}

.app-card-thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    border-radius: 14px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
}

.app-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border-radius: 14px;
}

.app-card:hover .app-card-thumbnail img {
    transform: scale(1.03);
}

.app-card-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    user-select: none;
    border-radius: 14px;
}

.app-card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.02em;
    padding: 14px 4px 0;
}

.app-card-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 4px 4px 0;
}

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 4px 4px;
}

.app-card-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.app-card-views {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 12px;
    border-radius: 980px;
    background: #e4e6ea;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.6;
}

.app-card-author {
    font-size: 13px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 980px;
    background: #e4e6ea;
}

.app-card-share {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    padding: 0;
}

.app-card:hover .app-card-share {
    color: var(--text-primary);
}

.app-card-share:hover {
    background: #e4e6ea;
    color: var(--text-primary) !important;
    transform: scale(1.1);
}

/* Subscribe (follow) button */
.app-card-subscribe {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    padding: 0;
}

.app-card:hover .app-card-subscribe {
    color: var(--text-primary);
}

.app-card-subscribe:hover {
    background: #e4e6ea;
    color: var(--text-primary) !important;
    transform: scale(1.1);
}

.app-card-subscribe.subscribed {
    color: #ff4757;
}

.app-card:hover .app-card-subscribe.subscribed {
    color: #ff4757;
}

.app-card-subscribe.subscribed:hover {
    color: #ff6b81 !important;
    background: rgba(255, 71, 87, 0.1);
}

.app-card-subscribe:disabled {
    cursor: not-allowed;
}

/* Dark mode overrides for neumorphic card */
@media (prefers-color-scheme: dark) {
    .app-card {
        background: #2a2d32;
        box-shadow: 4px 4px 10px rgba(0,0,0,0.3), -3px -3px 8px rgba(255,255,255,0.04);
        border-color: rgba(255,255,255,0.06);
    }
    .app-card:hover {
        box-shadow: 6px 6px 14px rgba(0,0,0,0.4), -3px -3px 10px rgba(255,255,255,0.05);
    }
    .app-card-thumbnail {
        background: #1e2024;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    }
    .app-card-views,
    .app-card-author {
        background: rgba(255,255,255,0.08);
    }
    .app-card-share:hover {
        background: rgba(255,255,255,0.1);
    }
    .app-card-subscribe:hover {
        background: rgba(255,255,255,0.1);
    }
    .app-card-subscribe.subscribed:hover {
        background: rgba(255, 71, 87, 0.15);
    }
}

/* ========================================
   App List & Grid
   ======================================== */
.plaza-app-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Category detail view */
.category-view-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0;
}

.category-view-back {
    padding: 7px 16px;
    border-radius: 980px;
    border: none;
    background: var(--nav-blue-light);
    color: var(--nav-blue);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.category-view-back:hover {
    background: rgba(37, 99, 235, 0.14);
}

.category-view-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.category-view-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ========================================
   Skeleton Loading
   ======================================== */
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-section { opacity: 0.5; }

.skeleton-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    background: var(--bg-card);
}

.skeleton-thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8ed 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
    flex-shrink: 0;
}

.skeleton-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8ed 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }

/* ========================================
   Loading / Error / Empty States
   ======================================== */
.plaza-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.plaza-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--apple-gray-5);
    border-top-color: var(--nav-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.plaza-error,
.plaza-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    gap: 12px;
    text-align: center;
}

.plaza-error-icon,
.plaza-empty-icon {
    font-size: 48px;
    margin-bottom: 4px;
}

.plaza-error-message,
.plaza-empty-text,
.plaza-empty-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
}

.plaza-error-retry {
    margin-top: 16px;
    padding: 10px 28px;
    background: var(--nav-blue);
    color: #fff;
    border: none;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.plaza-error-retry:hover { opacity: 0.85; }

.plaza-loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ========================================
   QR Code Modal
   ======================================== */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.qr-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    padding: 36px;
    min-width: 280px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
    animation: modalIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes modalIn {
    from { transform: scale(0.92) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.qr-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--apple-gray-6);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.qr-modal-close:hover {
    background: var(--apple-gray-5);
    color: var(--text-primary);
}

.qr-modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-modal-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-canvas canvas,
.qr-modal-canvas img {
    border-radius: var(--radius-sm);
}

.qr-modal-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}

.qr-modal-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
    max-width: 260px;
}

.qr-modal-url-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: #f5f5f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    cursor: text;
}

.qr-modal-copy-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
    color: #fff;
    background: #007AFF;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.qr-modal-copy-btn:hover {
    background: #0063d1;
}

.qr-modal-error {
    font-size: 13px;
    color: #FF3B30;
    text-align: center;
    padding: 20px 0;
}

/* ========================================
   Responsive - Tablet (≤1024px)
   ======================================== */
@media (max-width: 1024px) {
    .plaza-category-nav {
        width: 170px;
        padding: 16px 10px;
    }

    .plaza-main {
        padding: 22px 24px 50px;
        gap: 16px;
    }

    .category-section-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .banner-item { aspect-ratio: 2.4 / 1; }
    .banner-item-title { font-size: 20px; }
    .banner-item-overlay { padding: 22px; }
    .category-section-title { font-size: 20px; }
}

/* ========================================
   Responsive - Mobile (≤768px)
   ======================================== */
@media (max-width: 768px) {
    .plaza-container {
        flex-direction: column;
    }

    .plaza-category-nav {
        width: 100%;
        height: auto;
        position: sticky;
        top: 48px;
        border-right: none;
        border-radius: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        padding: 12px 16px;
        overflow-x: visible;
        overflow-y: visible;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: rgba(255,255,255,0.96);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }

    /* 开始创作按钮 + 搜索框：移到底部悬浮栏 */
    .plaza-nav-top-row {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-top: none;
    }

    .plaza-create-btn {
        margin-bottom: 0;
        flex-shrink: 0;
        width: auto;
        padding: 9px 20px;
        font-size: 14px;
        white-space: nowrap;
        order: -2;
    }

    .plaza-search-box {
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
        order: -1;
        background: rgba(255, 255, 255, 0.85);
    }

    /* 分类列表横向滚动 pill 样式 */
    .plaza-category-list {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .plaza-category-list::-webkit-scrollbar { display: none; }

    .plaza-category-item {
        padding: 7px 16px;
        border-radius: 980px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
        background: rgba(0, 0, 0, 0.04);
        color: var(--text-secondary);
        font-weight: 500;
    }

    .plaza-category-item.active {
        background: var(--nav-blue);
        color: #fff;
        font-weight: 600;
    }

    .plaza-category-item .category-icon { display: none; }

    .plaza-search-title { font-size: 22px; }

    .plaza-filter-row { gap: 24px; }

    .plaza-main {
        padding: 16px 16px 80px;
        gap: 14px;
    }

    .plaza-banner { border-radius: var(--radius-md); }
    .banner-item { aspect-ratio: 16 / 9; }
    .banner-item-overlay { padding: 18px; }
    .banner-item-title { font-size: 18px; }
    .banner-item-desc { font-size: 12px; }

    .banner-arrow {
        opacity: 1;
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .banner-arrow-prev { left: 8px; }
    .banner-arrow-next { right: 8px; }

    .category-section { gap: 12px; padding-bottom: 28px; }
    .category-section-title { font-size: 18px; }

    .category-section-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .app-card-thumbnail-placeholder { font-size: 32px; }

    .category-view-title { font-size: 22px; }

    .qr-modal {
        margin: 16px;
        min-width: auto;
        width: calc(100% - 32px);
        max-width: none;
        padding: 28px 20px;
    }

    .plaza-error, .plaza-empty { padding: 60px 16px; }
}

/* ========================================
   Responsive - Small Mobile (≤480px)
   ======================================== */
@media (max-width: 480px) {
    .plaza-category-nav {
        padding: 10px 12px;
        gap: 8px;
    }

    .plaza-nav-top-row {
        padding: 8px 12px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
    }

    .plaza-create-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .plaza-main {
        padding: 12px 12px 80px;
        gap: 12px;
    }

    .app-card { padding: 10px 10px 8px; border-radius: 16px; }
    .app-card-thumbnail { border-radius: 10px; }
    .app-card-title { font-size: 14px; padding-top: 10px; }
    .app-card-share { width: 30px; height: 30px; }
    .app-card-views { font-size: 11px; padding: 2px 8px; }
    .app-card-author { font-size: 11px; padding: 2px 8px; }
    .app-card-thumbnail-placeholder { font-size: 26px; }

    .banner-item-title { font-size: 15px; }
    .banner-item-desc { font-size: 11px; }
    .banner-item-overlay { padding: 14px; }
    .category-section-title { font-size: 16px; }
    .category-section-viewall { font-size: 14px; }
}
