/* AI 应用广场。只给 agent-plaza-layout 用。参考 stitch 13_ai_pc_oiioii_1 / 13_ai_pc_oiioii_2。 */

body.studio.agent-plaza-layout .st-main,
body.studio.agent-plaza-layout .st-main-inner {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

.agent-plaza {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1440px;
    min-width: 0;
    margin-inline: auto;
    padding-bottom: 32px;
    overflow-x: clip;
}

.agent-plaza-header,
.agent-plaza-toolbar {
    min-width: 0;
    max-width: 100%;
}

.agent-plaza-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agent-plaza-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agent-plaza-search {
    flex: 0 0 auto;
}

.agent-plaza-search .st-search {
    background: var(--st-elevated);
}

.agent-plaza .ui-svg-icon {
    display: block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.agent-plaza-pills {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.agent-plaza-pills::-webkit-scrollbar {
    display: none;
    height: 0;
}

.agent-plaza-layout .nav-category {
    flex-shrink: 0;
    border: 1px solid var(--st-border-strong);
    border-radius: var(--st-radius-pill);
    background: var(--st-surface);
    transition: background-color var(--st-duration) ease, border-color var(--st-duration) ease, color var(--st-duration) ease;
}

.agent-plaza-layout .nav-category a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 16px;
    color: var(--st-text-muted);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.agent-plaza-layout .nav-category.active,
.agent-plaza-layout .nav-category:hover {
    border-color: var(--st-seg-active-bg);
    background: var(--st-seg-active-bg);
}

.agent-plaza-layout .nav-category.active a,
.agent-plaza-layout .nav-category:hover a {
    color: var(--st-seg-active-text);
}

.agent-plaza-result {
    min-height: 280px;
}

.agent-plaza-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agent-plaza-count {
    color: var(--st-text-muted);
    font-size: 13px;
}

.agent-plaza-count strong {
    color: var(--st-text);
    font-weight: 600;
}

.agent-plaza .catalog-grid-container,
.agent-plaza-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 20px;
}

.agent-plaza-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 14px;
    border: 1px solid var(--st-border-strong);
    border-radius: var(--st-radius-lg);
    background: var(--st-surface);
    box-shadow: var(--st-shadow-card);
    cursor: pointer;
    transition: border-color var(--st-duration) ease, box-shadow var(--st-duration) ease, background-color var(--st-duration) ease;
}

.agent-plaza-card:hover {
    border-color: color-mix(in srgb, var(--st-accent) 40%, var(--st-border-strong));
}

.agent-plaza-card:focus-visible {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.agent-plaza-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-md);
}

.agent-plaza-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-plaza-cover-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.agent-plaza-cover-icon svg {
    width: 24px;
    height: 24px;
}

.agent-plaza-category {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    max-width: calc(100% - 16px);
    padding: 2px 8px;
    overflow: hidden;
    border: 1px solid var(--st-border-strong);
    border-radius: 6px;
    background: color-mix(in srgb, var(--st-canvas) 88%, transparent);
    color: var(--st-text-muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.agent-plaza-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
    min-width: 0;
}

.agent-plaza-name {
    margin: 0;
    color: var(--st-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.agent-plaza-card:hover .agent-plaza-name {
    color: var(--st-accent);
}

.agent-plaza-desc {
    margin: 0;
    overflow: hidden;
    color: var(--st-text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-plaza-card[data-result-type="video"]:hover {
    border-color: #fcd34d;
}

.agent-plaza-card[data-result-type="video"]:hover .agent-plaza-name {
    color: #d97706;
}

.agent-plaza-card[data-result-type="video"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, #fffbeb, #fefce8, rgba(255, 247, 237, 0.6));
    border-color: rgba(254, 243, 199, 0.8);
}

.agent-plaza-card[data-result-type="video"] .agent-plaza-cover-icon {
    background: #ffffff;
    border-color: #fde68a;
    color: #f59e0b;
    box-shadow: var(--st-shadow-card);
}

.agent-plaza-card[data-result-type="image"]:hover {
    border-color: #93c5fd;
}

.agent-plaza-card[data-result-type="image"]:hover .agent-plaza-name {
    color: #2563eb;
}

.agent-plaza-card[data-result-type="image"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, #eff6ff, #f0f9ff, rgba(238, 242, 255, 0.6));
    border-color: rgba(219, 234, 254, 0.8);
}

.agent-plaza-card[data-result-type="image"] .agent-plaza-cover-icon {
    background: #ffffff;
    border-color: #bfdbfe;
    color: #2563eb;
    box-shadow: var(--st-shadow-card);
}

.agent-plaza-card[data-result-type="audio"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, #fdf2f8, #fff1f2, rgba(255, 241, 242, 0.6));
    border-color: rgba(251, 207, 232, 0.8);
}

.agent-plaza-card[data-result-type="audio"] .agent-plaza-cover-icon {
    background: #ffffff;
    border-color: #fbcfe8;
    color: #db2777;
    box-shadow: var(--st-shadow-card);
}

.agent-plaza-card[data-result-type="text"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, #fffbeb, #fefce8, rgba(255, 247, 237, 0.6));
    border-color: rgba(253, 230, 138, 0.8);
}

.agent-plaza-card[data-result-type="text"] .agent-plaza-cover-icon {
    background: #ffffff;
    border-color: #fde68a;
    color: #d97706;
    box-shadow: var(--st-shadow-card);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="video"]:hover {
    border-color: rgba(245, 158, 11, 0.4);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="video"]:hover .agent-plaza-name {
    color: #fbbf24;
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="video"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, rgba(69, 26, 3, 0.4), rgba(113, 63, 18, 0.2), #070709);
    border-color: rgba(255, 255, 255, 0.05);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="video"] .agent-plaza-cover-icon {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    box-shadow: none;
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="image"]:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="image"]:hover .agent-plaza-name {
    color: #60a5fa;
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="image"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, rgba(23, 37, 84, 0.4), rgba(22, 78, 99, 0.2), #070709);
    border-color: rgba(255, 255, 255, 0.05);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="image"] .agent-plaza-cover-icon {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    box-shadow: none;
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="audio"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, rgba(80, 7, 36, 0.4), rgba(136, 19, 55, 0.2), #070709);
    border-color: rgba(255, 255, 255, 0.05);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="audio"] .agent-plaza-cover-icon {
    background: rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.3);
    color: #f472b6;
    box-shadow: none;
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="text"] .agent-plaza-cover {
    background: linear-gradient(to bottom right, rgba(69, 26, 3, 0.4), rgba(113, 63, 18, 0.2), #070709);
    border-color: rgba(255, 255, 255, 0.05);
}

html.dark .studio.agent-plaza-layout .agent-plaza-card[data-result-type="text"] .agent-plaza-cover-icon {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
    box-shadow: none;
}

@media (min-width: 640px) {
    .agent-plaza .catalog-grid-container,
    .agent-plaza-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .agent-plaza .catalog-grid-container,
    .agent-plaza-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .agent-plaza .catalog-grid-container,
    .agent-plaza-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .agent-plaza-toolbar {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .agent-plaza-pills {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .agent-plaza-search,
    .agent-plaza-search .st-search {
        width: 100%;
    }
}

@media (min-width: 1536px) {
    .agent-plaza .catalog-grid-container,
    .agent-plaza-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
