/* ==========================================================================
   朔光与墨 · 作品集页样式 (Doodle Studio Style)
   设计语言：纸白 + 墨黑厚边硬阴影 + 五彩涂鸦点缀
   ========================================================================== */

body.page-projects { overflow-x: clip; }
body.page-projects .toast { position: fixed; z-index: 9999; }

/* ==========================================================================
   HERO · 涂鸦标题区
   ========================================================================== */

.projects-hero {
    position: relative;
    padding: 144px 24px 64px;
    overflow: hidden;
    text-align: center;
}

.projects-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    background: var(--ink);
    color: var(--yellow);
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 2px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-hard-sm);
    text-transform: uppercase;
}

.hero-kicker svg {
    width: 14px;
    height: 14px;
    color: var(--yellow);
}

.hero-title {
    margin-top: 22px;
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: clamp(48px, 9vw, 96px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.hero-sub {
    margin-top: 18px;
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 涂鸦几何装饰 */
.hero-blob {
    position: absolute;
    border: 4px solid var(--ink);
    pointer-events: none;
    z-index: 1;
}

.hero-blob.b1 {
    top: 96px;
    left: 6%;
    width: 96px;
    height: 96px;
    background: var(--yellow);
    border-radius: 50%;
    opacity: 0.6;
    animation: doodle-float 5s ease-in-out infinite;
}

.hero-blob.b2 {
    bottom: 32px;
    right: 8%;
    width: 120px;
    height: 120px;
    background: var(--pink);
    border-radius: 50%;
    opacity: 0.35;
    animation: doodle-float 6s ease-in-out infinite reverse;
}

.hero-blob.b3 {
    top: 40%;
    right: 18%;
    width: 36px;
    height: 36px;
    background: var(--blue);
    transform: rotate(15deg);
    border-width: 2px;
    opacity: 0.6;
}

@keyframes doodle-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(8deg); }
}

/* ==========================================================================
   MAIN · 卡片网格
   ========================================================================== */

.projects-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

/* ==========================================================================
   PROJECT CARD · 涂鸦便签风
   ========================================================================== */

.project-card {
    position: relative;
    background: #fff;
    border: 2.5px solid var(--ink);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-hard);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                box-shadow 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--shadow-hard-xl);
}

.project-card:nth-child(3n+1) { transform: rotate(-0.6deg); }
.project-card:nth-child(3n+2) { transform: rotate(0.4deg); }
.project-card:nth-child(3n+3) { transform: rotate(-0.3deg); }
.project-card:nth-child(3n+1):hover { transform: rotate(-0.6deg) translate(-3px, -3px); }
.project-card:nth-child(3n+2):hover { transform: rotate(0.4deg) translate(-3px, -3px); }
.project-card:nth-child(3n+3):hover { transform: rotate(-0.3deg) translate(-3px, -3px); }

/* 封面 */
.project-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--paper);
    overflow: hidden;
    border-bottom: 2.5px solid var(--ink);
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-cover img {
    transform: scale(1.04);
}

/* 封面占位（无封面时） */
.project-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 12px,
            rgba(26, 26, 26, 0.04) 12px,
            rgba(26, 26, 26, 0.04) 13px
        ),
        var(--paper);
    color: var(--text-muted);
}

.project-cover-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* 重要项目徽章 */
.project-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 4px 8px;
    background: var(--yellow);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-hard-sm);
}

.project-featured-badge svg {
    width: 12px;
    height: 12px;
    color: var(--ink);
}

/* 卡片正文 */
.project-body {
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.project-title {
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 20px;
    line-height: 1.3;
    color: var(--ink);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 技术栈 */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.project-tech-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
}

/* 卡片底部 */
.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 4px;
    border-top: 1.5px dashed rgba(26, 26, 26, 0.15);
}

.project-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.project-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--ink);
    color: #fff;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}

.project-card:hover .project-arrow {
    background: var(--blue);
    transform: rotate(-45deg);
}

.project-arrow svg {
    width: 16px;
    height: 16px;
}

/* 重要项目卡片左侧色带 */
.project-card.is-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--yellow);
    z-index: 3;
}

/* ==========================================================================
   EMPTY · 空状态
   ========================================================================== */

.projects-empty {
    text-align: center;
    padding: 80px 20px 120px;
}

.projects-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    background: var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
}

.projects-empty-icon svg {
    width: 32px;
    height: 32px;
}

.projects-empty-title {
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 6px;
}

.projects-empty-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .projects-hero {
        padding: 110px 20px 48px;
    }

    .hero-blob.b1 {
        top: 60px;
        left: 4%;
        width: 72px;
        height: 72px;
    }

    .hero-blob.b2 {
        bottom: 24px;
        right: 4%;
        width: 96px;
        height: 96px;
    }

    .projects-main {
        padding: 0 16px 80px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .project-card:nth-child(n) {
        transform: rotate(0);
    }

    .project-card:nth-child(n):hover {
        transform: translate(-2px, -2px);
    }
}
