/* ============ 云吸猫 v3 ============ */
.cat-hero {
    margin-top: 28px;
    padding: 26px 28px 32px;
    border-radius: 18px;
    background: linear-gradient(160deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.1);
}
[data-theme="dark"] .cat-hero {
    background: linear-gradient(160deg, #2b1c0e 0%, #2e2010 100%);
    border-color: rgba(253, 186, 116, 0.16);
}

/* ---- 头部 ---- */
.cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.cat-brand { display: flex; align-items: center; gap: 14px; }
.cat-logo {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border-radius: 14px;
    background: linear-gradient(145deg, #fed7aa, #fb923c);
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.35);
}
.cat-title { font-size: 22px; font-weight: 800; color: #7c2d12; }
[data-theme="dark"] .cat-title { color: #ffedd5; }
.cat-sub { font-size: 13px; color: #fb923c; margin-top: 2px; }
[data-theme="dark"] .cat-sub { color: #fdba74; }

.cat-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-stat {
    min-width: 66px;
    text-align: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #fed7aa;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.1);
}
[data-theme="dark"] .cat-stat { background: rgba(60, 38, 16, 0.6); border-color: rgba(253, 186, 116, 0.2); }
.cat-stat b { display: block; font-size: 20px; font-weight: 800; color: #ea580c; }
.cat-stat span { font-size: 11px; color: #fb923c; }
[data-theme="dark"] .cat-stat span { color: #fdba74; }

/* ---- 工具栏 ---- */
.cat-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.cat-seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #fed7aa;
    border-radius: 11px;
}
[data-theme="dark"] .cat-seg { background: rgba(60, 38, 16, 0.5); border-color: rgba(253, 186, 116, 0.2); }
.cat-seg button {
    border: 0;
    background: transparent;
    padding: 7px 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: #b45309;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.cat-seg button.active {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: #fff;
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35);
}
[data-theme="dark"] .cat-seg button { color: #fdba74; }

.cat-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #b45309;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #fed7aa;
    border-radius: 11px;
    user-select: none;
}
[data-theme="dark"] .cat-check { background: rgba(60, 38, 16, 0.5); border-color: rgba(253, 186, 116, 0.2); color: #fdba74; }
.cat-check input { accent-color: #ea580c; width: 16px; height: 16px; cursor: pointer; }

/* ---- 画廊 ---- */
.cat-gallery {
    display: grid;
    gap: 14px;
}
.cat-gallery[data-mode="1"] { grid-template-columns: 1fr; }
.cat-gallery[data-mode="4"] { grid-template-columns: repeat(2, 1fr); }
.cat-gallery[data-mode="9"] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
    .cat-gallery[data-mode="4"], .cat-gallery[data-mode="9"] { grid-template-columns: 1fr; }
}

.cat-card {
    background: #fff;
    border: 2px solid #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(249, 115, 22, 0.12);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: catCardIn .4s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(249, 115, 22, 0.2); }
@keyframes catCardIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
[data-theme="dark"] .cat-card { background: #2e2010; border-color: rgba(253, 186, 116, 0.16); }

.cat-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    overflow: hidden;
}
[data-theme="dark"] .cat-card-img { background: linear-gradient(135deg, #33220f, #3a2a12); }
.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .25s ease;
}

/* 滤镜 */
.cat-card-img img.f-gray { filter: grayscale(1); }
.cat-card-img img.f-sepia { filter: sepia(0.7) contrast(1.06); }
.cat-card-img img.f-negative { filter: invert(1) hue-rotate(180deg); }
.cat-card-img img.f-soft { filter: blur(1.2px) brightness(1.06); }

.cat-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #c2410c;
    font-size: 13px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    z-index: 2;
}
[data-theme="dark"] .cat-loading { background: linear-gradient(135deg, #33220f, #3a2a12); color: #fdba74; }
.cat-loading[hidden] { display: none; }
.cat-spinner {
    width: 34px; height: 34px;
    border: 4px solid #fed7aa;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: cat-spin 0.9s linear infinite;
}
@keyframes cat-spin { to { transform: rotate(360deg); } }

.cat-err {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    color: #9a3412;
    background: #fff7ed;
    z-index: 2;
}
.cat-err div { font-size: 36px; }
.cat-err[hidden] { display: none; }
[data-theme="dark"] .cat-err { background: #33220f; color: #fdba74; }

/* 收藏 / 下载按钮 */
.cat-fav-btn, .cat-dl-btn {
    position: absolute;
    z-index: 5;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border: 0;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
    transition: all .2s ease;
    text-decoration: none;
    color: inherit;
}
.cat-fav-btn:hover { transform: scale(1.15); }
.cat-fav-btn.on { animation: catHeart .45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes catHeart {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.cat-fav-btn { top: 10px; right: 10px; }
.cat-dl-btn { bottom: 10px; right: 10px; font-size: 15px; }
[data-theme="dark"] .cat-fav-btn, [data-theme="dark"] .cat-dl-btn { background: rgba(40, 26, 12, 0.85); }

.cat-caption {
    padding: 8px 12px;
    font-size: 12.5px;
    color: #9a5b1f;
    text-align: center;
    line-height: 1.5;
}
[data-theme="dark"] .cat-caption { color: #e0b184; }

/* ---- 按钮 ---- */
.cat-actions { margin-top: 20px; text-align: center; }
.cat-btn {
    border: 0;
    border-radius: 12px;
    background: #f97316;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 30px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 5px 14px rgba(249, 115, 22, 0.35);
}
.cat-btn:hover { background: #ea580c; transform: translateY(-1px); }
.cat-btn:active { transform: translateY(0); }
[data-theme="dark"] .cat-btn { background: #ea580c; }
[data-theme="dark"] .cat-btn:hover { background: #f97316; }

.cat-tip { margin-top: 12px; font-size: 12px; color: #fdba74; text-align: center; }

/* ---- 收藏与最近 ---- */
.cat-section-title {
    font-size: 15px;
    font-weight: 800;
    color: #7c2d12;
    margin: 26px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .cat-section-title { color: #ffedd5; }
.cat-sec-num { font-size: 12px; color: #fb923c; font-weight: 600; }

.cat-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.cat-fav-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #fed7aa;
    background: #fff;
    cursor: pointer;
    transition: transform .2s ease;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.1);
}
.cat-fav-item:hover { transform: translateY(-2px); }
[data-theme="dark"] .cat-fav-item { background: #2e2010; border-color: rgba(253, 186, 116, 0.2); }
.cat-fav-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.cat-fav-item .cf-cap {
    padding: 6px 10px;
    font-size: 12px;
    color: #9a5b1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="dark"] .cat-fav-item .cf-cap { color: #e0b184; }
.cat-fav-item .cf-del {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}
[data-theme="dark"] .cat-fav-item .cf-del { background: rgba(40, 26, 12, 0.85); }

.cat-empty {
    text-align: center;
    font-size: 13px;
    color: #fdba74;
    padding: 18px 0;
    border: 1px dashed #fed7aa;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cat-empty { background: rgba(60, 38, 16, 0.3); }

.cat-recent-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: thin;
}
.cat-recent-item {
    flex: 0 0 92px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fed7aa;
    cursor: pointer;
    transition: transform .2s ease;
}
.cat-recent-item:hover { transform: translateY(-2px) scale(1.03); }
[data-theme="dark"] .cat-recent-item { border-color: rgba(253, 186, 116, 0.2); }
.cat-recent-item img { width: 92px; height: 70px; object-fit: cover; display: block; }

/* ---- 信息区 ---- */
.cat-info { margin-top: 30px; }

@media (max-width: 640px) {
    .cat-hero { padding: 20px 12px; }
}
