/* 全局样式 */
:root {
    --primary-pink: #FFB6C1; /* 淡粉色 */
    --secondary-pink: #FF69B4; /* 热力粉 */
    --accent-pink: #FFC0CB; /* 浅粉色 */
    --text-dark: #333;
    --text-light: #fff;
    --bg-light: #fdfdfd;
    --border-color: #ffe4e1; /* 浅桃红色 */
    --shadow-light: rgba(255, 182, 193, 0.3); /* 粉色阴影 */
    --font-family-cute: 'Comic Sans MS', 'Arial', sans-serif; /* 可爱字体占位，实际可用思源宋体等更优字体 */
    --border-radius-large: 15px;
    --border-radius-small: 8px;
}

body {
    font-family: var(--font-family-cute);
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden; /* 防止水平滚动 */

    /* === 新增/修改开始 === */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* === 新增/修改结束 === */
}

a {
    text-decoration: none;
    color: var(--secondary-pink);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-pink);
}

/* 布局辅助类 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.site-header {
    background-color: var(--primary-pink);
    color: var(--text-light);
    padding: 15px 0;
    box-shadow: 0 4px 8px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap; /* 允许换行 */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent-pink);
    object-fit: cover;
}

.site-name {
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.nav-right {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
    flex-wrap: wrap; /* 允许换行 */
    justify-content: center; /* 居中显示 */
}

.nav-right li a {
    color: var(--text-light);
    font-weight: bold;
    padding: 8px 15px;
    border-radius: var(--border-radius-small);
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative; /* 用于下划线效果 */
}

.nav-right li a:hover,
.nav-right li a.active {
    background-color: var(--secondary-pink);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px var(--shadow-light);
}

/* 导航项激活状态下划线效果 */
.nav-right li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: var(--accent-pink);
    border-radius: 2px;
}

/* 联系方式 */
.contact-info {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 10px 20px;
    background-color: var(--accent-pink);
    border-top: 1px solid var(--primary-pink);
    flex-wrap: wrap; /* 允许换行 */
    margin-top: 15px; /* === 新增：与导航块的间距 === */
}

.contact-item {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.contact-item .icon {
    width: 28px;
    height: 28px;
    fill: var(--secondary-pink); /* === 修改为粉色 === */
    transition: transform 0.2s ease;
}

.contact-item:hover .icon {
    transform: scale(1.1);
}

.contact-item .tooltip-text {
    visibility: hidden;
    width: auto;
    background-color: var(--secondary-pink);
    color: var(--text-light);
    text-align: center;
    border-radius: var(--border-radius-small);
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* 放置在图标上方 */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    white-space: nowrap; /* 防止文本换行 */
}

.contact-item .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--secondary-pink) transparent transparent transparent;
}

.contact-item:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 主要内容区 */
.site-content {
    padding: 30px 0;
    min-height: 60vh; /* 确保内容区有最小高度 */

    /* === 新增/修改开始 === */
    flex-grow: 1; /* 让内容区域占据所有可用空间，将页脚推到底部 */
    /* === 新增/修改结束 === */
}

.content-section {
    display: none; /* 默认隐藏所有内容区 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section.active {
    display: block; /* 激活时显示 */
}

.content-section h2 {
    text-align: center;
    color: var(--secondary-pink);
    font-size: 2.5em;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-pink);
    border-radius: 2px;
}

.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 响应式网格布局 */
    gap: 30px;
    padding: 20px 0;
}

/* 域名卡片样式 (将由 JS 动态生成，但样式在此定义) */
.domain-card {
    background-color: var(--text-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative; /* 用于头像和域名的定位 */
    overflow: hidden; /* 确保内容不溢出圆角 */
}

.domain-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-light);
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--secondary-pink);
    flex-shrink: 0; /* 防止头像缩小 */
}

.card-info {
    flex-grow: 1;
}

.card-domain-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--secondary-pink);
    margin-bottom: 5px;
    word-break: break-word; /* 防止长域名溢出 */
}

.card-description {
    font-size: 0.9em;
    color: var(--text-dark);
    opacity: 0.8;
}

/* 域名详情弹窗 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 2000; /* 确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* 半透明背景 */
    display: flex; /* 注意：这里是用于弹窗显示时的居中，默认是 none */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-light);
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius-large);
    border: 3px solid var(--primary-pink);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 25px var(--shadow-light);
    position: relative;
    animation: fadeIn 0.3s ease-out; /* 弹窗出现动画 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h3 {
    text-align: center;
    color: var(--secondary-pink);
    font-size: 2em;
    margin-bottom: 20px;
}

.detail-info p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.detail-info strong {
    color: var(--primary-pink);
    margin-right: 5px;
}

.close-button {
    color: var(--primary-pink);
    font-size: 2.5em;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--secondary-pink);
}


/* 页脚样式 */
.site-footer {
    background-color: var(--primary-pink);
    color: var(--text-light);
    text-align: center;
    padding: 20px 0;
    margin-top: 30px; /* 保留一些与内容区的间距 */
    box-shadow: 0 -2px 8px var(--shadow-light);
}

.site-footer p {
    margin: 0;
    font-size: 0.9em;
}

/* 媒体查询 - 响应式设计 */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .nav-left {
        width: 100%;
        justify-content: center;
    }

    .nav-right {
        margin-top: 15px;
        /* flex-direction: column; <--- 删除此行，保持横向 */
        gap: 10px; /* 仍然保持一些间距 */
        width: 100%;
        display: flex; /* 确保它是 flex 容器 */
        justify-content: space-evenly; /* 或者 space-around，让菜单项均匀分布 */
        align-items: center; /* 垂直居中 */
        padding: 0 10px; /* 添加左右内边距，防止贴边 */
        box-sizing: border-box; /* 确保 padding 不增加总宽度 */
        flex-wrap: wrap; /* 允许在极窄时换行 */
    }

    .nav-right li {
        /* width: 80%; <--- 根据实际效果，你可能需要删除或调整此行 */
        text-align: center;
    }

    .contact-info {
        /* flex-direction: column; <--- 删除此行，保持横向 */
        display: flex; /* 确保它是 flex 容器 */
        justify-content: center; /* 让图标居中排列 */
        align-items: center;
        gap: 15px; /* 保持图标间距 */
        padding: 15px 10px;
        flex-wrap: wrap; /* 如果图标过多，允许它们换行 */
    }

    .contact-item .tooltip-text {
        bottom: auto; /* 移除固定定位 */
        top: 125%; /* 放置在图标下方 */
        left: 50%;
        transform: translateX(-50%);
        white-space: normal; /* 允许文本换行 */
        width: max-content; /* 自适应内容宽度 */
    }

    .contact-item .tooltip-text::after {
        top: -5px; /* 箭头在上部 */
        border-color: transparent transparent var(--secondary-pink) transparent;
    }

    .content-section h2 {
        font-size: 2em;
    }

    .domain-grid {
        grid-template-columns: 1fr; /* 在小屏幕上单列显示 */
        padding: 0 15px;
    }

    .domain-card {
        flex-direction: column; /* 卡片在小屏幕上堆叠 */
        text-align: center;
    }

    .card-avatar {
        margin-bottom: 10px;
    }

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

    .modal-content {
        padding: 20px;
    }

    .modal-content h3 {
        font-size: 1.5em;
    }

    .close-button {
        font-size: 2em;
        top: 5px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .site-name {
        font-size: 1.5em;
    }
    .logo img {
        width: 40px;
        height: 40px;
    }
    .contact-item .icon {
        width: 24px;
        height: 24px;
    }
}
