/* ============================================================
   闲沐工坊 · 类别页公共样式
   设计语言延续首页：深蓝渐变背景 + 金色 #ffd700 主色 + 毛玻璃卡片
   每页通过 body 上的 --accent / --accent-soft 变量注入专属主题色
   ============================================================ */

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

:root {
    --gold: #ffd700;
    --text: #fff;
    --text-dim: #b8c0d0;
    --text-faint: #8892a6;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent: #ffd700;
    --accent-soft: rgba(255, 215, 0, 0.14);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 900px 480px at 85% -10%, var(--accent-soft), transparent 60%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    background-attachment: fixed;
    font-family: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- 顶栏 ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 1.25rem;
    background: rgba(15, 15, 35, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700, #ff6b6b, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.crumb {
    color: var(--text-faint);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-home {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-dim);
    padding: 6px 16px;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.back-home:hover {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.4);
}

/* ---------- 类别 Hero ---------- */

.cat-hero {
    text-align: center;
    padding: 3.5rem 0 2.5rem;
}

.cat-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.cat-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 0.6rem;
}

.cat-hero h1 em,
.proj h2 em {
    font-style: normal;
    color: var(--accent);
}

.cat-hero p {
    max-width: 640px;
    margin: 0 auto;
    color: var(--text-dim);
    font-size: 1rem;
}

.anchor-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.anchor-nav a {
    font-size: 0.9rem;
    color: var(--text-dim);
    padding: 7px 18px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all 0.25s ease;
}

.anchor-nav a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- 项目区块 ---------- */

.proj {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    padding: 2rem;
    margin-bottom: 2.5rem;
    scroll-margin-top: 80px;
}

.proj-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.proj-head > div:first-child { flex: 1 1 320px; }

.proj h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.proj-tagline {
    color: var(--accent);
    font-size: 1rem;
}

.proj-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ddc84;
    box-shadow: 0 0 8px rgba(61, 220, 132, 0.8);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.btn-visit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #14162b;
    background: linear-gradient(135deg, var(--accent), var(--accent-2, #ffce54));
    padding: 9px 22px;
    border-radius: 50px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--accent-soft);
}

.proj-desc {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

/* ---------- 数据带 ---------- */

.stats-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
}

.stat b {
    display: block;
    font-size: 1.45rem;
    color: var(--accent);
    font-weight: 700;
}

.stat span {
    font-size: 0.82rem;
    color: var(--text-faint);
}

/* ---------- 功能卡片 ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.feature {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.feature b {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.feature span {
    font-size: 0.85rem;
    color: var(--text-faint);
    line-height: 1.55;
}

/* ---------- 截图 ---------- */

.shot {
    margin: 0 0 1.5rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.25);
}

.shot img { width: 100%; }

.shot figcaption {
    font-size: 0.82rem;
    color: var(--text-faint);
    text-align: center;
    padding: 8px 12px;
    border-top: 1px solid var(--card-border);
}

.shot-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.shot-row .shot { margin: 0; }

/* ---------- 链接 chips ---------- */

.links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-dim);
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.25s ease;
}

.chip:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- GitHub 仓库网格（开源页） ---------- */

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1.2rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
}

.repo-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.repo-card h3 {
    font-size: 1rem;
    color: var(--accent);
    word-break: break-all;
}

.repo-card p {
    font-size: 0.86rem;
    color: var(--text-dim);
    flex: 1;
}

.repo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.repo-meta span {
    font-size: 0.75rem;
    color: var(--text-faint);
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
}

.repo-meta span.hl { color: #ffd700; border-color: rgba(255, 215, 0, 0.35); }

/* ---------- 模型网格（3D 打印页） ---------- */

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 1.5rem;
}

.model-card {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.model-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #0d0f1e;
}

.model-card .model-info {
    padding: 0.85rem 1rem 1rem;
}

.model-card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.model-card span {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--accent);
}

/* ---------- 二维码横幅（闲鱼/自媒体） ---------- */

.qr-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 215, 0, 0.4);
    margin-bottom: 1.5rem;
    text-align: center;
}

.qr-panel img {
    width: 300px;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
}

.qr-panel .qr-text { flex: 1 1 260px; }

.qr-panel .qr-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.qr-panel .qr-text p {
    color: var(--text-dim);
    font-size: 0.92rem;
}

/* ---------- 自媒体卡片 ---------- */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.media-card {
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.media-card:hover {
    transform: translateY(-6px);
    border-color: var(--mc, var(--accent));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}

.media-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--mc, var(--accent));
    color: #fff;
    font-weight: 700;
}

.media-card h3 { font-size: 1.1rem; }

.media-card .acc {
    font-size: 0.88rem;
    color: var(--text-dim);
    word-break: break-all;
}

.media-card img {
    width: 100%;
    max-width: 220px;
    border-radius: 12px;
    background: #fff;
    padding: 5px;
}

.media-card .placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-faint);
    font-size: 0.9rem;
}

.media-card .placeholder .icon { font-size: 2rem; opacity: 0.5; }

.media-card .btn-visit,
.media-card .chip { margin-top: auto; }

/* ---------- 安装提示卡 ---------- */

.install-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1.1rem 1.25rem 1.15rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, 0.04));
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft) inset;
    margin-bottom: 1.5rem;
}

.install-box .label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-size: 0.78rem;
    font-weight: 700;
    color: #14162b;
    background: var(--accent);
    padding: 3px 12px;
    border-radius: 50px;
    letter-spacing: 1px;
}

.install-box .step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.install-box .step b {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #14162b;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.install-box code {
    font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 8px;
    border-radius: 5px;
    word-break: break-all;
}

.install-box .download {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #14162b;
    background: var(--accent);
    padding: 8px 20px;
    border-radius: 50px;
    margin-top: 4px;
    transition: all 0.25s ease;
}

.install-box .download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px var(--accent-soft);
}

/* ---------- 复制提示块 ---------- */

.prompt-box {
    position: relative;
    margin-top: 4px;
    padding: 1rem;
    padding-right: 7.5rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--accent);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.7;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    padding: 5px 14px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    line-height: 1.2;
    z-index: 2;
}

.copy-btn:hover {
    background: var(--accent);
    color: #14162b;
}

.copy-btn.copied {
    background: #3ddc84;
    border-color: #3ddc84;
    color: #14162b;
}

.quote {
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 0 14px 14px 0;
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ---------- 底部类别导航 ---------- */

.cat-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 1rem 0 2.5rem;
}

.cat-nav a {
    font-size: 0.88rem;
    color: var(--text-dim);
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all 0.25s ease;
}

.cat-nav a:hover {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.45);
}

/* ---------- 页脚 ---------- */

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    padding: 1.75rem 1.25rem 2.25rem;
    color: #555f74;
    font-size: 0.85rem;
}

.site-footer .foot-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-bottom: 0.9rem;
}

.site-footer .foot-links a {
    color: #7a849c;
    transition: color 0.25s ease;
}

.site-footer .foot-links a:hover { color: var(--gold); }

.site-footer a { color: #7a849c; }
.site-footer a:hover { color: var(--gold); }

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
    .cat-hero { padding: 2.25rem 0 1.75rem; }
    .cat-hero h1 { font-size: 1.7rem; }
    .proj { padding: 1.4rem; }
    .proj-head { flex-direction: column; }
    .proj-actions { width: 100%; }
    .btn-visit { flex: 1; justify-content: center; }
    .shot-row { grid-template-columns: 1fr; }
    .crumb { display: none; }
}
