/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgb(242, 242, 247);
    min-height: 100vh;
    color: rgb(29, 29, 31);
    line-height: normal;
}

/* 字体类 */
.lora {
    font-family: "Lora", serif;
}

.noto-sans {
    font-family: "Noto Sans SC", sans-serif;
}

.noto-serif {
    font-family: "Noto Serif SC", serif;
}

/* 主容器 */
#root {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#container {
    max-width: 1200px;
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
}

#bento {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    width: 100%;
    aspect-ratio: 4/2;
    grid-template-areas:
        "namecard techstack techstack starsign"
        "namecard geekdeath heatmap heatmap";
}

/* 通用样式类 */
.full-height {
    height: 100%;
}

.min-height-zero {
    min-height: 0;
}

.text-center {
    text-align: center;
}

.flex-shrink-zero {
    flex-shrink: 0;
}

/* 网格区域定义 */
.long-grid {
    grid-area: namecard;
}

#techstack-grid {
    grid-area: techstack;
    aspect-ratio: 2/1;
    width: 100%;
}

#starsign-grid {
    grid-area: starsign;
    aspect-ratio: 1/1;
}

#nav-grid {
    grid-area: geekdeath;
    aspect-ratio: 1/1;
}

#heatmap-grid {
    grid-area: heatmap;
}

/* 卡片基础样式 */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 个人信息卡片 */
#name-card {
    position: relative;
    background: linear-gradient(135deg, #e8d5f2 0%, #b8d4f0 50%, #f2d5e8 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    color: #4a3d5a;
}

#noise-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    pointer-events: none;
    background-size: 200px 200px;
    background-repeat: repeat;
}

#profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.profile-image img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid rgba(74, 61, 90, 0.2);
}

.profile-info h2 {
    font-size: 32px;
    font-weight: 700;
    color: #4a3d5a;
    margin: -8px 0 8px 0;
    line-height: normal;
}

.profile-info h3 {
    font-size: 14px;
    font-weight: 300;
    color: rgba(74, 61, 90, 0.7);
    margin: 0 0 20px 0;
    line-height: normal;
}

#contact-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

#contact-info a {
    color: rgba(74, 61, 90, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

#contact-info a:hover {
    color: #4a3d5a;
}

#contact-info span {
    color: rgba(74, 61, 90, 0.8);
    font-size: 14px;
}

/* Moment卡片 */
#techstack-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

#techstack-card h4 {
    font-size: 24px;
    font-weight: 600;
    color: rgb(29, 29, 31);
    margin: 0 0 16px 0;
}

.techstack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    gap: 16px;
    flex: 1;
    align-items: center;
    justify-items: center;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.tech-item:hover {
    transform: scale(1.05);
}

.tech-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.tech-name {
    font-size: 14px;
    font-weight: 500;
    color: rgb(29, 29, 31);
    text-align: center;
}

/* Life stream卡片 */
#starsign-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

#starsign-card h4 {
    font-size: 24px;
    font-weight: 600;
    color: rgb(29, 29, 31);
    line-height: 1.4;
    margin: 0 0 16px 0;
}

.social-platforms {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.social-link {
    display: inline-block;
    transition: transform 0.2s ease;
}

.social-link:hover {
    transform: scale(1.1);
}

.social-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.birth-year {
    font-size: 14px;
    color: rgba(29, 29, 31, 0.7);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}



/* 导航卡片 */
.navigation-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.navigation-card-text h4 {
    font-size: 24px;
    font-weight: 600;
    color: rgb(29, 29, 31);
    margin-bottom: 4px;
}

.navigation-card-text p {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
}

.navigation-card-image img {
    width: 128px;
    height: 128px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* 热力图卡片 */
#heatmap-card {
    display: flex;
    flex-direction: column;
}

#heatmap-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: rgb(29, 29, 31);
    margin-bottom: 16px;
}

#cal-heatmap {
    width: 100%;
    flex: 1;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5);
    min-height: 80px;
}

/* 页脚 */
footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

footer a:hover {
    color: rgb(29, 29, 31);
}

#beian {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#beian img {
    width: 16px;
    height: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        align-items: center;
        padding: 16px 0;
    }

    #container {
        padding: 16px;
        max-width: 100%;
    }

    #bento {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
        aspect-ratio: unset;
        grid-template-areas:
            "namecard"
            "techstack"
            "starsign"
            "geekdeath"
            "heatmap";
    }

    .card {
        padding: 16px;
    }

    #profile {
        flex-direction: column;
        gap: 12px;
    }

    .profile-info h2 {
        font-size: 20px;
    }

    #contact-info {
        justify-content: center;
        gap: 12px;
    }

    #techstack-card h4 {
        font-size: 20px;
    }

    .techstack-grid {
        gap: 12px;
    }

    .tech-icon {
        width: 28px;
        height: 28px;
    }

    .tech-name {
        font-size: 12px;
    }

    .navigation-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .navigation-card-image {
        order: -1;
    }
}

@media (max-width: 480px) {
    #container {
        padding: 12px;
    }

    .card {
        padding: 12px;
    }

    .profile-image img {
        width: 48px;
        height: 48px;
    }

    .profile-info h2 {
        font-size: 18px;
    }

    #contact-info a {
        font-size: 11px;
    }

    #techstack-card h4 {
        font-size: 18px;
    }

    .techstack-grid {
        gap: 8px;
    }

    .tech-icon {
        width: 24px;
        height: 24px;
    }

    .tech-name {
        font-size: 11px;
    }

    #starsign-card h4 {
        font-size: 14px;
    }

    .navigation-card-text h4 {
        font-size: 14px;
    }

    .navigation-card-text p {
        font-size: 11px;
    }

    .navigation-card-image img {
        width: 24px;
        height: 24px;
    }

    #heatmap-card h4 {
        font-size: 14px;
    }

    footer {
        font-size: 10px;
    }
}
