:root {
    --sidebar-width: 292px;
    --primary: #6236ff;
    --primary-2: #2f7dff;
    --ink: #101828;
    --muted: #667085;
    --line: #e6eaf2;
    --soft: #f6f8fb;
    --dark: #06122a;
    --dark-2: #020912;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f7f9fc;
}
a { text-decoration: none; }
.web-shell { display: flex; min-height: 100vh; }
.web-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    color: #fff;
    background: radial-gradient(circle at 30% 0, rgba(98,54,255,.55), transparent 32%), linear-gradient(180deg, var(--dark), var(--dark-2));
    padding: 24px 18px;
    overflow-y: auto;
    z-index: 1050;
}
.web-brand { display: flex; align-items: center; gap: 14px; color: #fff; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.web-brand:hover { color: #fff; }
.web-logo {
    width: 56px; height: 56px; border-radius: 16px;
    display: grid; place-items: center;
    background: linear-gradient(135deg,#2f7dff,#7b2cff);
    color: #fff; font-weight: 900; font-size: 20px;
    box-shadow: 0 16px 30px rgba(91,44,255,.35);
}
.web-brand strong { display: block; font-size: 20px; line-height: 1.1; }
.web-brand small { display: block; color: #9daac3; margin-top: 3px; }
.web-nav { display: grid; gap: 7px; margin-top: 22px; }
.web-link {
    display: flex; align-items: center; gap: 14px;
    color: rgba(255,255,255,.86);
    padding: 13px 14px;
    border-radius: 14px;
    font-weight: 600;
}
.web-link:hover, .web-link.active {
    color: #fff;
    background: linear-gradient(135deg, #6039ff, #7138ff);
    box-shadow: 0 12px 26px rgba(91,44,255,.28);
}
.sidebar-mini-card {
    margin-top: 28px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    background: rgba(255,255,255,.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.sidebar-mini-card p { margin: 10px 0 16px; color: #b8c2d8; font-size: 13px; line-height: 1.55; }
.web-content-wrap { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); min-height: 100vh; }
.web-topbar {
    min-height: 88px;
    display: flex; align-items: center; gap: 20px;
    padding: 16px 28px;
    position: sticky; top: 0; z-index: 980;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}
.web-page-title { margin: 0; font-size: 23px; font-weight: 850; letter-spacing: -.02em; }
.web-page-subtitle { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.top-search { position: relative; width: min(430px, 40vw); margin-left: auto; }
.top-search .form-control { border-radius: 14px; padding: 12px 48px 12px 16px; border-color: #d9e1ee; }
.top-search button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; width: 36px; height: 36px; border-radius: 11px; background: #eef2ff; color: var(--primary); }
.web-main { padding: 26px 28px 38px; }
.web-footer { display: flex; justify-content: space-between; gap: 16px; color: #53657e; font-size: 13px; padding: 10px 28px 28px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; background: #eef2ff; color: var(--primary); border: 0; }
.hero-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 26px;
    padding: 34px;
    border-radius: 28px;
    color: #fff;
    background: radial-gradient(circle at 10% 0, rgba(47,125,255,.72), transparent 34%), radial-gradient(circle at 85% 20%, rgba(123,44,255,.75), transparent 35%), linear-gradient(135deg, #071225, #0d1830 64%, #050b16);
    box-shadow: 0 24px 70px rgba(10,20,40,.18);
    margin-bottom: 28px;
}
.hero-panel:after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.06); right: -120px; bottom: -150px; }
.hero-copy, .hero-stats { position: relative; z-index: 1; }
.hero-copy h2 { font-size: clamp(32px, 5vw, 58px); line-height: 1.02; letter-spacing: -.05em; margin: 15px 0; font-weight: 900; }
.hero-copy p { max-width: 720px; color: #c9d4ea; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { border-radius: 13px; font-weight: 700; }
.btn-primary { background: linear-gradient(135deg,#6236ff,#4324d9); border: none; box-shadow: 0 10px 26px rgba(91,44,255,.28); }
.btn-outline-light { border-color: rgba(255,255,255,.35); }
.hero-stats { display: grid; gap: 14px; align-content: center; }
.hero-stats div { padding: 22px; border-radius: 22px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.hero-stats strong { display: block; font-size: 34px; line-height: 1; }
.hero-stats span { color: #c5d1e7; font-size: 13px; }
.pill-soft, .prompt-badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #4b22e8;
    background: #eef2ff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.section-block { margin: 30px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.section-heading h3 { margin: 0; font-weight: 850; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.section-row { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.section-row > * { flex: 0 0 290px; scroll-snap-align: start; }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.prompt-card, .category-card, .section-head-card, .detail-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 10px 34px rgba(16,24,40,.05);
}
.prompt-card { overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.prompt-card:hover { transform: translateY(-4px); box-shadow: 0 18px 46px rgba(16,24,40,.11); }
.prompt-thumb-wrap { position: relative; aspect-ratio: 16 / 11; background: #eef2f7; overflow: hidden; }
.prompt-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-card-body { padding: 16px; }
.prompt-title { color: var(--ink); font-size: 17px; font-weight: 850; line-height: 1.3; margin: 10px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-preview { color: var(--muted); font-size: 13px; line-height: 1.52; min-height: 39px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: #667085; font-size: 12px; }
.prompt-meta span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: #f2f4f7; }
.prompt-flags { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.prompt-badge { color: #fff; background: rgba(3,8,23,.72); backdrop-filter: blur(8px); text-transform: none; letter-spacing: 0; padding: 7px 10px; }
.category-card { padding: 18px; min-height: 166px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); transition: transform .18s ease, box-shadow .18s ease; }
.category-card:hover { transform: translateY(-4px); box-shadow: 0 18px 46px rgba(16,24,40,.11); color: var(--ink); }
.category-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#6236ff,#2f7dff); font-weight: 900; font-size: 20px; }
.category-card h4 { font-size: 18px; margin: 14px 0 6px; font-weight: 850; }
.category-card p { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-card footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; color: var(--primary); font-weight: 800; font-size: 13px; }
.loading-state, .empty-state {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}
.section-head-card { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 25px; margin-bottom: 22px; }
.section-head-card h2 { margin: 12px 0 6px; font-weight: 900; letter-spacing: -.035em; }
.section-head-card p { color: var(--muted); margin: 0; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { border: 1px solid #d9e1ee; border-radius: 999px; background: #fff; padding: 9px 15px; font-weight: 800; color: #344054; }
.chip.active, .chip:hover { background: #eef2ff; color: var(--primary); border-color: #c8d1ff; }
.search-filter-card { min-width: min(100%, 780px); display: grid; grid-template-columns: 1.3fr .7fr .7fr auto; gap: 10px; }
.form-control, .form-select { border-color: #d9e1ee; border-radius: 12px; min-height: 44px; }
.detail-card { overflow: hidden; }
.detail-cover { aspect-ratio: 21 / 8; background: #eef2f7; overflow: hidden; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-body { padding: 26px; }
.detail-title { font-size: clamp(28px, 4vw, 48px); font-weight: 900; letter-spacing: -.05em; margin: 12px 0; }
.detail-copy-box { border: 1px solid #d9e1ee; background: #fbfcff; border-radius: 18px; padding: 18px; white-space: pre-wrap; line-height: 1.72; color: #233049; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tags span { background: #f2f4f7; color: #344054; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 700; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: grid; gap: 10px; }
.mini-toast { padding: 12px 16px; background: #101828; color: #fff; border-radius: 14px; box-shadow: 0 14px 34px rgba(16,24,40,.2); }
.sidebar-backdrop { display: none; }
code { color: #4b22e8; }
@media (max-width: 1100px) {
    .hero-panel { grid-template-columns: 1fr; }
    .search-filter-card { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 992px) {
    :root { --sidebar-width: 0px; }
    .web-sidebar { transform: translateX(-100%); transition: .25s ease; width: 292px; }
    .web-sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(2,9,18,.55); z-index: 1040; }
    .web-content-wrap { margin-left: 0; width: 100%; }
    .top-search { display: none; }
    .web-topbar { padding: 14px 18px; }
    .web-main { padding: 18px; }
    .web-footer { padding: 10px 18px 24px; flex-direction: column; }
}
@media (max-width: 720px) {
    .hero-panel { padding: 24px; border-radius: 24px; }
    .section-head-card { display: block; }
    .search-filter-card { grid-template-columns: 1fr; margin-top: 16px; }
    .section-row > * { flex-basis: 250px; }
    .detail-cover { aspect-ratio: 16 / 10; }
}


/* ===== MOBILE GALLERY FRONTEND UPGRADE (MATCHED APP STYLE) ===== */
body.gallery-body {
    min-height: 100svh;
    color: #fff;
    background:
        radial-gradient(circle at 8% 4%, rgba(117, 61, 255, .20), transparent 28%),
        radial-gradient(circle at 92% 2%, rgba(19, 188, 255, .10), transparent 24%),
        #020813;
    overflow-x: hidden;
}
.gallery-body .web-shell { display: block; min-height: 100svh; }
.gallery-body .web-sidebar,
.gallery-body .web-topbar,
.gallery-body .web-footer { display: none !important; }
.gallery-body .web-content-wrap { width: 100%; margin-left: 0; min-height: 100svh; }
.gallery-body .web-main {
    width: min(100%, 860px);
    min-height: 100svh;
    margin: 0 auto;
    padding: 34px 22px 132px;
    background:
        linear-gradient(180deg, rgba(10,18,31,.70), rgba(2,8,18,.96)),
        radial-gradient(circle at 50% -8%, rgba(98, 54, 255, .18), transparent 36%);
    border-left: 1px solid rgba(148, 163, 184, .10);
    border-right: 1px solid rgba(148, 163, 184, .10);
    box-shadow: 0 0 0 1px rgba(255,255,255,.02), 0 30px 100px rgba(0,0,0,.45);
}
.gallery-screen { position: relative; }
.gallery-filters {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 18px 8px 32px;
    margin: -8px -8px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.gallery-filters::-webkit-scrollbar { display: none; }
.gallery-filter {
    position: relative;
    flex: 0 0 104px;
    height: 134px;
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: 27px;
    color: #fff;
    background: linear-gradient(180deg, rgba(22, 28, 42, .86), rgba(8, 13, 24, .86));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 34px rgba(0,0,0,.32);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.gallery-filter:hover { transform: translateY(-2px); }
.gallery-filter strong { font-size: 14px; font-weight: 760; line-height: 1; }
.gallery-filter em {
    position: absolute;
    left: 50%; bottom: 11px;
    width: 0; height: 5px;
    border-radius: 99px;
    transform: translateX(-50%);
    background: #b581ff;
    box-shadow: 0 0 18px rgba(181,129,255,.95);
    transition: width .22s ease;
}
.gallery-filter.active {
    border-color: rgba(151, 71, 255, .94);
    background: radial-gradient(circle at 50% 25%, rgba(129, 60, 255, .56), rgba(22, 28, 42, .88) 62%, rgba(8,13,24,.92));
    box-shadow: 0 0 0 1px rgba(151, 71, 255, .38), 0 0 28px rgba(119, 72, 255, .36), 0 22px 46px rgba(0,0,0,.45);
}
.gallery-filter.active em { width: 48px; }
.filter-icon { display: grid; place-items: center; width: 54px; height: 54px; font-size: 34px; line-height: 1; filter: drop-shadow(0 0 13px currentColor); }
.filter-icon.purple { color: #b58cff; }
.filter-icon.green { color: #0ee7a8; }
.filter-icon.blue { color: #2f7dff; }
.filter-icon.pink { color: #d86bff; }
.filter-icon.orange { color: #ff8542; }
.filter-icon.rose { color: #ff4f86; }
.filter-icon.yellow { color: #ffd064; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.gallery-card {
    position: relative;
    display: block;
    overflow: hidden;
    isolation: isolate;
    aspect-ratio: 1 / 1.34;
    border-radius: 24px;
    background: #071120;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 44px rgba(0,0,0,.34);
    transform: translateZ(0);
    transition: transform .26s ease, border-color .26s ease, box-shadow .26s ease;
}
.gallery-card:hover { transform: translateY(-3px); border-color: rgba(181, 140, 255, .40); box-shadow: 0 22px 56px rgba(0,0,0,.44); }
.gallery-card:active { transform: scale(.985); }
.gallery-card .image-skeleton {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.13) 18%, rgba(255,255,255,.04) 36%) 0 0 / 220% 100%,
        linear-gradient(135deg, rgba(66, 41, 142, .28), rgba(2, 8, 18, .75));
    animation: galleryShimmer 1.18s infinite linear;
    z-index: 1;
}
.gallery-card.loaded .image-skeleton { opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility .28s ease; }
.gallery-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.035);
    transition: opacity .46s ease, transform .72s cubic-bezier(.2,.7,.2,1);
}
.gallery-card.loaded .gallery-img { opacity: 1; transform: scale(1); }
.gallery-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.44) 100%);
}
.views-chip {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    background: rgba(2, 8, 18, .36);
    border: 1px solid rgba(255,255,255,.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 26px rgba(0,0,0,.30);
}
.gallery-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 86px;
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 700;
}
.gallery-loader.hidden { display: none; }
.infinite-spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(181, 140, 255, .18);
    border-top-color: #b58cff;
    box-shadow: 0 0 18px rgba(181, 140, 255, .46);
    animation: gallerySpin .72s linear infinite;
}
.gallery-end {
    display: none;
    text-align: center;
    color: rgba(255,255,255,.48);
    font-size: 12px;
    font-weight: 700;
    padding: 22px 0 6px;
}
.gallery-end.show { display: block; }
.gallery-sentinel { width: 100%; height: 1px; }
.app-tabbar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 3000;
    width: min(calc(100% - 32px), 820px);
    min-height: 96px;
    padding: 13px 24px calc(13px + env(safe-area-inset-bottom));
    border-radius: 42px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(6, 12, 23, .76);
    border: 1px solid rgba(148, 163, 184, .16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 -8px 45px rgba(0,0,0,.58);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}
.tab-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    color: rgba(255,255,255,.88);
    font-size: 34px;
    transition: color .22s ease, transform .22s ease;
}
.tab-link:hover { color: #fff; transform: translateY(-2px); }
.tab-link.active { color: #b58cff; filter: drop-shadow(0 0 14px rgba(181,140,255,.9)); }
.tab-link span {
    position: absolute;
    bottom: -6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
}
.tab-link.active span { opacity: 1; }
@keyframes gallerySpin { to { transform: rotate(360deg); } }
@keyframes galleryShimmer { to { background-position: -220% 0, 0 0; } }
@media (max-width: 760px) {
    .gallery-body .web-main { padding: 24px 16px 124px; border: 0; }
    .gallery-filters { gap: 14px; padding-bottom: 26px; }
    .gallery-filter { flex-basis: 92px; height: 124px; border-radius: 24px; }
    .filter-icon { width: 48px; height: 48px; font-size: 30px; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .gallery-card { border-radius: 20px; }
    .app-tabbar { min-height: 82px; border-radius: 34px; padding-left: 12px; padding-right: 12px; }
    .tab-link { width: 52px; height: 52px; font-size: 29px; }
}
@media (max-width: 380px) {
    .gallery-body .web-main { padding-left: 12px; padding-right: 12px; }
    .gallery-grid { gap: 10px; }
    .gallery-filter { flex-basis: 84px; height: 116px; }
    .gallery-filter strong { font-size: 12px; }
}


/* ===== EXACT MOBILE GALLERY MATCH + ROOT FRONTEND FIX ===== */
body.gallery-body {
    background: #020711 !important;
}
.gallery-body .web-main {
    width: min(100%, 850px) !important;
    padding: 46px 22px 134px !important;
    border: 1px solid rgba(118, 139, 170, .18);
    border-radius: 38px;
    overflow: hidden;
}
.gallery-filters {
    gap: 18px !important;
    padding: 10px 4px 38px !important;
    margin: 0 -4px !important;
}
.gallery-filter {
    flex: 0 0 112px !important;
    height: 132px !important;
    border-radius: 28px !important;
    background: linear-gradient(180deg, rgba(20,26,38,.88), rgba(8,13,24,.92)) !important;
}
.gallery-filter strong {
    font-size: 14px !important;
    color: rgba(255,255,255,.96);
}
.gallery-filter.active {
    background:
        radial-gradient(circle at 50% 22%, rgba(138,75,255,.60), rgba(22,23,42,.88) 56%, rgba(11,14,26,.94)) !important;
}
.filter-icon {
    width: 54px !important;
    height: 54px !important;
    font-size: 36px !important;
}
.gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
.gallery-card {
    aspect-ratio: 1 / 1.34 !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255,255,255,.20) !important;
    background: #07101d !important;
}
.views-chip {
    right: 9px !important;
    bottom: 9px !important;
    min-height: 28px !important;
    padding: 6px 9px !important;
    font-size: 11px !important;
    background: rgba(4, 9, 18, .38) !important;
}
.gallery-loader {
    padding-bottom: 18px;
}
@media (max-width: 760px) {
    .gallery-body .web-main {
        width: 100% !important;
        padding: 32px 16px 120px !important;
        border-radius: 30px;
    }
    .gallery-filters {
        gap: 14px !important;
        padding-bottom: 30px !important;
    }
    .gallery-filter {
        flex-basis: 96px !important;
        height: 126px !important;
        border-radius: 24px !important;
    }
    .filter-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 31px !important;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
    .gallery-card {
        border-radius: 18px !important;
    }
    .app-tabbar {
        width: min(calc(100% - 28px), 790px) !important;
        min-height: 82px !important;
        border-radius: 34px !important;
    }
}
@media (max-width: 430px) {
    .gallery-body .web-main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .gallery-filter {
        flex-basis: 86px !important;
        height: 116px !important;
    }
    .gallery-filter strong {
        font-size: 12px !important;
    }
    .gallery-grid {
        gap: 10px !important;
    }
    .views-chip {
        font-size: 10px !important;
        padding: 5px 7px !important;
    }
}


/* ===== Single Prompt Mobile Detail UI (screenshot style) ===== */
body.prompt-detail-screen {
    background:
        radial-gradient(circle at 12% 0%, rgba(122, 70, 255, .12), transparent 32%),
        radial-gradient(circle at 92% 12%, rgba(53, 125, 255, .10), transparent 28%),
        #050812;
    color: #fff;
}

body.prompt-detail-screen .web-sidebar,
body.prompt-detail-screen .web-topbar,
body.prompt-detail-screen .web-footer,
body.prompt-detail-screen .app-tabbar {
    display: none !important;
}

body.prompt-detail-screen .web-shell {
    display: block;
    min-height: 100vh;
    background: transparent;
}

body.prompt-detail-screen .web-content-wrap {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
    background: transparent;
}

body.prompt-detail-screen .web-main {
    padding: 0 !important;
    max-width: none !important;
    min-height: 100vh;
    background: transparent;
}

body.prompt-detail-screen #promptDetail {
    width: 100%;
}

.mobile-prompt-detail {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 32px 56px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 30% -10%, rgba(255,255,255,.06), transparent 38%),
        linear-gradient(180deg, #070b15 0%, #03050a 100%);
    border-left: 1px solid rgba(255,255,255,.05);
    border-right: 1px solid rgba(255,255,255,.05);
    box-shadow: 0 0 80px rgba(0,0,0,.5);
}

.detail-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 34px;
}

.detail-circle-btn {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.075);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 34px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 30px rgba(0,0,0,.24);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.detail-circle-btn:active {
    transform: scale(.94);
}

.detail-circle-btn.saved {
    color: #fff;
    border-color: rgba(168, 99, 255, .55);
    box-shadow: 0 0 34px rgba(144, 80, 255, .32), inset 0 1px 0 rgba(255,255,255,.12);
}

.detail-hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    min-height: 420px;
    aspect-ratio: 1.24 / 1;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.055);
    box-shadow: 0 28px 70px rgba(0,0,0,.42);
}

.detail-hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity .45s ease, transform .65s ease;
}

.detail-hero-card.loaded img {
    opacity: 1;
    transform: scale(1);
}

.detail-image-loader {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(110deg, rgba(255,255,255,.06) 8%, rgba(255,255,255,.15) 18%, rgba(255,255,255,.06) 33%),
        rgba(255,255,255,.045);
    background-size: 220% 100%;
    animation: detailShimmer 1.25s linear infinite;
}

.detail-hero-card.loaded .detail-image-loader {
    display: none;
}

@keyframes detailShimmer {
    to { background-position-x: -220%; }
}

.generate-btn {
    width: 100%;
    height: 84px;
    margin: 30px 0;
    border: 0;
    border-radius: 24px;
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    letter-spacing: .01em;
    background: linear-gradient(135deg, #7a3cff 0%, #6730e8 50%, #742cff 100%);
    box-shadow: 0 18px 44px rgba(113, 64, 255, .34), inset 0 1px 0 rgba(255,255,255,.28);
    transition: transform .2s ease, filter .2s ease;
}

.generate-btn:active {
    transform: scale(.985);
    filter: brightness(1.08);
}

.prompt-glass-card {
    position: relative;
    padding: 28px;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.13);
    background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
    box-shadow: 0 18px 55px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.prompt-card-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.prompt-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #7a42ff, #3d168e);
    box-shadow: 0 10px 28px rgba(122, 66, 255, .28);
}

.prompt-card-head h1 {
    margin: 0;
    color: #fff;
    font-size: 29px;
    line-height: 1;
    font-weight: 800;
    flex: 1;
}

.prompt-collapse-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    color: #c8c9d4;
    background: rgba(255,255,255,.08);
    display: grid;
    place-items: center;
    font-size: 24px;
}

.prompt-text {
    color: rgba(235, 235, 245, .76);
    font-size: 24px;
    line-height: 1.48;
    white-space: pre-wrap;
    transition: max-height .3s ease;
}

.prompt-text.collapsed {
    max-height: 174px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}

.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    margin: 14px auto 0;
    border: 0;
    background: transparent;
    color: #9b63ff;
    font-size: 23px;
    line-height: 1;
    font-weight: 800;
}

.detail-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 22px 0 30px;
}

.detail-action-btn {
    min-height: 78px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.12);
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035));
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.detail-action-btn i {
    font-size: 29px;
    color: rgba(235,235,245,.78);
}

.open-tools {
    display: grid;
    gap: 18px;
}

.open-tool-card {
    min-height: 116px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035));
    color: #fff;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 22px;
    box-shadow: 0 14px 40px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.open-tool-card:hover {
    color: #fff;
    border-color: rgba(155, 99, 255, .35);
}

.tool-logo {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 34px;
}

.chatgpt-logo {
    color: #15e1a4;
    background: rgba(12, 184, 134, .13);
}

.gemini-logo {
    color: #78a8ff;
    background: rgba(62, 106, 255, .12);
}

.tool-copy {
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.tool-copy strong {
    color: #fff;
    font-size: 25px;
    line-height: 1.05;
}

.tool-copy small {
    color: rgba(235,235,245,.62);
    font-size: 19px;
    line-height: 1.25;
}

.tool-open-icon {
    color: #9b63ff;
    font-size: 28px;
}

.related-detail-section {
    margin-top: 36px;
    padding-bottom: 24px;
}

.related-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.related-detail-head h2 {
    color: #fff;
    font-size: 27px;
    margin: 0;
    font-weight: 850;
}

.related-detail-head a {
    color: #9b63ff;
    font-weight: 800;
}

.related-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.related-gallery-grid .gallery-card {
    min-height: 0;
    aspect-ratio: .78 / 1;
    border-radius: 20px;
    margin: 0;
}

.related-gallery-grid .views-chip {
    font-size: 11px;
    padding: 6px 8px;
}

.related-loader {
    display: grid;
    place-items: center;
    min-height: 70px;
}

@media (max-width: 640px) {
    .mobile-prompt-detail {
        padding: max(20px, env(safe-area-inset-top)) 18px 40px;
        width: 100%;
        border: 0;
    }

    .detail-top-actions {
        margin-bottom: 26px;
    }

    .detail-circle-btn {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .detail-hero-card {
        min-height: 300px;
        border-radius: 28px;
    }

    .generate-btn {
        height: 72px;
        margin: 24px 0;
        font-size: 24px;
        border-radius: 22px;
    }

    .prompt-glass-card {
        padding: 22px;
        border-radius: 24px;
    }

    .prompt-card-head h1 {
        font-size: 25px;
    }

    .prompt-text {
        font-size: 20px;
    }

    .detail-action-grid {
        gap: 14px;
    }

    .detail-action-btn {
        min-height: 70px;
        font-size: 22px;
        border-radius: 20px;
    }

    .open-tool-card {
        min-height: 100px;
        padding: 18px 20px;
        border-radius: 22px;
    }

    .tool-logo {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        font-size: 29px;
    }

    .tool-copy strong {
        font-size: 21px;
    }

    .tool-copy small {
        font-size: 16px;
    }

    .related-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .related-gallery-grid .gallery-card {
        border-radius: 16px;
    }
}

@media (max-width: 430px) {
    .mobile-prompt-detail {
        padding-left: 14px;
        padding-right: 14px;
    }

    .detail-hero-card {
        min-height: 255px;
        aspect-ratio: 1.08 / 1;
    }

    .prompt-text {
        font-size: 18px;
    }

    .detail-action-btn {
        gap: 11px;
        font-size: 19px;
    }

    .detail-action-btn i {
        font-size: 24px;
    }

    .related-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
