/* AI 产品广场：列表 / 详情 / 提交 */

/* ---------- 列表 ---------- */
.sq-page { padding-top: 26px; padding-bottom: 56px; }
/* 页头横幅：文字沿用 home.css 的 .page-* 组件，右侧几张错落的产品卡片做装饰 */
.sq-hero {
    position: relative;
    margin-bottom: 22px;
    padding: 32px 40px 0;
    overflow: hidden;
    border: 1px solid var(--primary-soft);
    border-radius: 20px;
    background:
        radial-gradient(480px 220px at 100% 0%, rgba(106, 92, 246, .12), transparent 70%),
        radial-gradient(420px 200px at 0% 100%, rgba(52, 120, 229, .10), transparent 70%),
        linear-gradient(135deg, #F7FAFF 0%, #EEF4FF 100%);
}
.sq-hero-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sq-hero-text { min-width: 0; }
/* 卡片底部的筛选条：贴着卡片左右边缘，用分隔线和上面隔开 */
.sq-hero .sq-toolbar {
    margin: 26px -40px 0;
    padding: 14px 40px;
    border-top: 1px solid var(--primary-soft);
    background: rgba(255, 255, 255, .72);
}
.sq-hero .sq-cats a, .sq-hero .sq-sort a { border-color: var(--border); }
.sq-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(52, 120, 229, .25);
}
.sq-hero-btn:hover { color: #fff; background: var(--primary-hover); }
.sq-hero-art { position: relative; flex: none; width: 280px; height: 190px; margin-right: 10px; }
.sq-art-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 150px;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(36, 50, 71, .12);
    animation: sq-art-float 5s ease-in-out infinite;
}
.sq-art-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--grad-primary);
    color: #fff;
    font-size: 15px;
}
.sq-art-card b, .sq-art-card s { display: block; height: 8px; border-radius: 4px; background: #E3EBF8; }
.sq-art-card b { width: 80%; }
.sq-art-card s { width: 55%; background: #EEF2F8; }
.sq-art-card.c1 { left: 0;    top: 40px; rotate: -6deg; }
.sq-art-card.c2 { left: 70px; top: 0;    z-index: 1; animation-delay: -1.7s; }
.sq-art-card.c2 i { background: linear-gradient(135deg, #34D399, #059669); }
.sq-art-card.c3 { left: 130px; top: 70px; rotate: 6deg; animation-delay: -3.4s; }
.sq-art-card.c3 i { background: linear-gradient(135deg, #FDBA74, #EA580C); }
@keyframes sq-art-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .sq-art-card { animation: none; } }
@media (max-width: 1000px) { .sq-hero-art { display: none; } }
@media (max-width: 768px) {
    .sq-hero { padding: 22px 18px 0; border-radius: 16px; }
    .sq-hero .sq-toolbar { margin: 20px -18px 0; padding: 12px 18px; }
}

.sq-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sq-cats { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.sq-cats a, .sq-sort a {
    padding: 6px 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 14.5px;
    white-space: nowrap;
}
.sq-cats a:hover, .sq-sort a:hover { color: var(--primary); }
.sq-cats a.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sq-sort { display: flex; flex-shrink: 0; gap: 4px; }
.sq-sort a { border: 0; background: transparent; }
.sq-sort a.is-on { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.sq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sq-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.sq-card:hover { border-color: var(--primary-soft); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); color: inherit; }
.sq-card-cover { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #f7f7f8; }
.sq-card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .3s; }
.sq-card:hover .sq-card-cover img { transform: scale(1.03); }
.sq-card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 4px 0; }
.sq-card-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); }
.sq-card-cat { color: var(--primary); font-weight: 600; }
.sq-card-title { margin-top: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 19px; font-weight: 700; color: var(--text-primary); }
.sq-card-tagline {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.4em;
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.sq-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 14.5px;
}
.sq-author { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; color: var(--text-primary); }
.sq-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13.5px;
    font-style: normal;
    font-weight: 700;
}
.sq-avatar-lg { width: 40px; height: 40px; font-size: 17px; }
.sq-likes { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; color: var(--text-muted); }
/* 纯 CSS 心形 */
.sq-heart {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 13px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sq-empty { padding: 60px 16px; border-radius: 14px; background: #fff; text-align: center; font-size: 15px; color: var(--text-muted); }
.sq-empty a { display: inline-block; margin-top: 6px; color: var(--primary); }

/* ---------- 详情 ---------- */
.sq-detail { padding-top: 18px; padding-bottom: 56px; }
.sq-breadcrumb { margin-bottom: 16px; }
.sq-preview-bar { margin-bottom: 14px; padding: 10px 16px; border-radius: 8px; background: var(--primary-light); font-size: 14.5px; color: var(--text-secondary); }
.sq-preview-bar a { margin-left: 8px; color: var(--primary); }
.sq-preview-2 { background: #FDECEE; }

/* 上下两块用同一套列宽，左右边线对齐 */
.sq-top, .sq-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sq-top { align-items: stretch; }
.sq-media, .sq-info, .sq-body { border: 1px solid var(--border-light); border-radius: 14px; background: #fff; }
.sq-media { overflow: hidden; }
.sq-media-stage { aspect-ratio: 16 / 9; background: #101114; }
.sq-media-item { display: block; width: 100%; height: 100%; object-fit: contain; }
.sq-media-item[hidden] { display: none; }
.sq-media-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 14.5px; }
.sq-media-bar button, .sq-media-bar > a, .sq-media-bar > span {
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    cursor: pointer;
}
.sq-media-bar button.is-on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sq-media-bar > a:hover { color: var(--primary); }
.sq-media-bar .sq-media-open { margin-left: auto; color: var(--text-muted); }

.sq-info {
    display: flex;
    flex-direction: column;
    padding: 28px 28px 24px;
    background:
        radial-gradient(360px 180px at 100% 0%, rgba(52, 120, 229, .08), transparent 70%),
        #fff;
}
.sq-chip { align-self: flex-start; padding: 4px 10px; border-radius: 6px; background: var(--primary-light); color: var(--primary); font-size: 14px; font-weight: 600; }
.sq-info-title { margin-top: 14px; font-size: 28px; line-height: 1.35; font-weight: 700; color: var(--text-primary); word-break: break-word; }
.sq-info-tagline { margin-top: 10px; font-size: 16px; line-height: 1.8; color: var(--text-secondary); }
.sq-info-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; list-style: none; }
.sq-info-meta li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--bg-page); }
.sq-info-meta span { font-size: 13px; color: var(--text-muted); }
.sq-info-meta b { font-size: 16px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sq-info-author { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 22px; }
.sq-info-author div { display: flex; flex-direction: column; min-width: 0; }
.sq-info-author strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; color: var(--text-primary); }
.sq-info-author small { font-size: 13px; color: var(--text-muted); }

.sq-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.sq-like { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-secondary); font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; }
.sq-like .sq-heart { width: 16px; height: 15px; }
.sq-like:hover { border-color: #F5B5BB; color: var(--accent); }
.sq-like.is-on { border-color: #F5B5BB; background: #FDECEE; color: var(--accent); }
.sq-like.is-on .sq-heart { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.6 1.2 4.3 2.4.7-1.2 2.2-2.4 4.3-2.4 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
.sq-like:disabled { cursor: default; opacity: .6; }
.sq-go { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 20px rgba(52, 120, 229, .22); }
.sq-go i { font-size: 13px; }
.sq-go:hover { color: #fff; background: var(--primary-hover); }

.sq-main { margin-top: 20px; }
.sq-main-left { min-width: 0; }
.sq-main .sq-body:first-child { margin-top: 0; }
.sq-body { margin-top: 20px; padding: 24px 28px; }
.sq-body h2 { margin-bottom: 14px; font-size: 19px; font-weight: 700; }
.sq-content { font-size: 16px; line-height: 1.9; color: var(--text-secondary); word-break: break-word; }
.sq-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sq-side .sq-body { margin-top: 0; padding: 20px 22px; }
.sq-more-item { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px; border-radius: 10px; color: inherit; }
.sq-more-item:hover { background: var(--bg-page); color: inherit; }
.sq-more-cover { flex: none; width: 104px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #f2f4f8; }
.sq-more-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.sq-more-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sq-more-text b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15.5px; color: var(--text-primary); }
.sq-more-text small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }
.sq-invite { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--primary-soft); border-radius: 14px; background: linear-gradient(135deg, #F7FAFF 0%, #EEF4FF 100%); color: inherit; }
.sq-invite:hover { border-color: var(--primary); color: inherit; }
.sq-invite > i { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad-primary); color: #fff; font-size: 16px; }
.sq-invite span { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.sq-invite b { font-size: 15.5px; color: var(--text-primary); }
.sq-invite small { font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }
.sq-invite em { flex: none; font-size: 14px; font-style: normal; font-weight: 600; color: var(--primary); }

/* ---------- 提交 ---------- */
.sq-submit { max-width: 760px; padding-top: 28px; padding-bottom: 60px; }
.sq-submit-hd h1 { font-size: 24px; font-weight: 700; }
.sq-submit-hd p { margin-top: 6px; font-size: 15px; color: var(--text-muted); }
.sq-form { margin-top: 20px; padding: 26px 28px; border: 1px solid var(--border-light); border-radius: 14px; background: #fff; }
.sq-field { margin-bottom: 22px; }
.sq-label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.sq-label em { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #FDECEE; color: var(--accent); font-size: 12.5px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.sq-optional { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--border-light); color: var(--text-muted); font-size: 12.5px; font-weight: 600; vertical-align: 1px; }
.sq-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
    outline: 0;
    transition: border-color .2s, box-shadow .2s;
}
.sq-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.sq-input::placeholder { color: #b8bcc4; }
.sq-textarea { height: 220px; padding: 12px 14px; line-height: 1.8; resize: vertical; }
.sq-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 13.5px; line-height: 1.7; color: var(--text-muted); }
.sq-count { flex-shrink: 0; }
.sq-upload {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    max-width: 420px;
    overflow: hidden;
    border: 1px dashed #bccdf3;
    border-radius: 10px;
    background: #f7f9fe;
    cursor: pointer;
}
.sq-upload:hover { border-color: var(--primary); }
.sq-upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sq-upload:not(.has-img) img { display: none; }
.sq-upload-tip { display: flex; flex-direction: column; gap: 4px; text-align: center; font-size: 13.5px; color: var(--text-muted); }
.sq-upload-tip b { font-size: 15px; color: var(--primary); }
.sq-upload.has-img .sq-upload-tip { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 13px; }
.sq-upload.has-img .sq-upload-tip b { color: #fff; }
.sq-upload.has-img .sq-upload-tip b::after { content: "（点击更换）"; font-weight: 400; }
.sq-upload.is-loading::after { content: "上传中..."; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .8); color: var(--primary); font-size: 15px; }
.sq-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 6px; }
.sq-btn { padding: 11px 26px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.sq-btn:hover { background: var(--primary-hover); }
.sq-btn:disabled { opacity: .7; cursor: default; }
.sq-btn-ghost { font-size: 15px; color: var(--text-secondary); }

@media (max-width: 1100px) {
    .sq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sq-top, .sq-main { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .sq-hero { flex-direction: column; align-items: flex-start; }
    .sq-hero h1 { font-size: 22px; }
    .sq-toolbar { flex-direction: column; align-items: stretch; }
    .sq-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .sq-cats::-webkit-scrollbar { display: none; }
    .sq-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .sq-detail { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .sq-top, .sq-main { grid-template-columns: minmax(0, 1fr); }
    .sq-info { padding: 20px 18px; }
    .sq-info-title { font-size: 22px; }
    .sq-info-meta { margin-top: 16px; }
    .sq-body, .sq-side .sq-body { padding: 20px 18px; }
    /* 手机端操作区固定在底部，随时能点「在线体验」 */
    .sq-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-light);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(8px);
    }
    .sq-form { padding: 20px 16px; }
    .sq-input { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    .sq-card-cover img { transition: none; }
    .sq-card:hover .sq-card-cover img { transform: none; }
}
