:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --container-bg: #fff;
    --card-bg: linear-gradient(to right, #4facfe, #00f2fe);
    --card-hover-bg: linear-gradient(to right, #00f2fe, #4facfe);
    --subtitle-color: #777;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --toggle-light-bg: linear-gradient(to right, #f2f3fe, #e9fefc); /* 日间按钮背景 */
    --toggle-dark-bg: linear-gradient(to right, #4f4f55, #6b7277); /* 夜间按钮背景 */
}

[data-theme="dark"] {
    --bg-color: #222;
    --text-color: #fff;
    --container-bg: #333;
    --card-bg: linear-gradient(to right, #555, #777);
    --card-hover-bg: linear-gradient(to right, #777, #999);
    --subtitle-color: #aaa;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background: var(--container-bg);
    border-radius: 16px;
    box-shadow: 0 4px 8px var(--shadow-color);
    max-width: 700px;
    padding: 40px;
    text-align: center;
    margin: 20px;
    box-sizing: border-box;
}

.title {
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--subtitle-color);
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 20px;
    border-radius: 10px;
    text-decoration: none;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--card-hover-bg);
}

.card-title {
    font-size: 18px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
    pointer-events: none;
    z-index: -1;
}

.icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold; /* 设置粗体 */
    font-size: 20px; /* 调整字体大小 */
    color: var(--text-color);
    margin: 30px 0; /* 增加上下间距 */
    position: relative;
}

.section-title::before,
.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ccc; /* 设置淡灰色分割线 */
    margin: 0 10px; /* 控制分割线和文字之间的距离 */
}

.theme-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    cursor: pointer;
}

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 3px solid var(--text-color);
}

.message {
    font-size: 16px;
    margin-bottom: 30px;
    color: var(--subtitle-color);
}

.logo {
    width: 120px;
    height: 120px;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    border-radius: 50%;
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bilibili-card {
    display: flex;
    align-items: center;
    background: var(--container-bg);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bilibili-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.bili-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
    object-fit: cover;
}

.bili-info {
    display: flex;
    flex-direction: column;
}

.bili-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bili-name {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-color);
}

.bili-level {
    height: 24px;
    width: auto;
}

.project-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 250px;
    background-color: var(--container-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--shadow-color);
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.project-card.has-cover {
    background-color: transparent;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.project-card:not(.has-cover) .project-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.15));
}

.project-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    text-align: left;
}

.project-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.project-card:not(.has-cover) .project-title {
    color: var(--text-color);
    text-shadow: none;
}

.project-description {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-card:not(.has-cover) .project-description {
    color: var(--subtitle-color);
    text-shadow: none;
}

.theme-toggle {
    position: fixed; /* 改为固定定位 */
    bottom: 20px; /* 距离视窗底部 20px */
    right: 20px; /* 距离视窗右侧 20px */
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--toggle-light-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 1000; /* 确保按钮在其他元素之上 */
}

.footer-links {
    margin-top: 40px;
    padding-top: 10px;
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.friend-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.friend-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

[data-theme="dark"] .theme-toggle {
    background: var(--toggle-dark-bg);
}

.theme-toggle:hover {
    transform: scale(1.1); /* 悬停时轻微放大 */
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Responsive Design */
@media (max-width: 600px) {
    .bilibili-card {
        flex-direction: column;
        text-align: center;
    }
    
    .bili-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .friend-links {
        flex-direction: column;
    }

    .friend-link {
        width: 100%;
        box-sizing: border-box;
    }
}
