/* style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #1a1a1a; /* 备用背景色 */
    position: relative; /* 确保伪元素可以正确定位 */
    z-index: 1;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
    opacity: 0;
    animation: fadeInBackground 1.5s ease-in-out forwards;
}

/* 移除了 #bg-iframe 样式 */

/* 新增：时钟模块样式 */
#clock-container {
    text-align: center;
    color: white;
    /* 添加文字阴影，使其在任何背景上都清晰可见 */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin: 40px auto;
}

#clock-time {
    font-size: 4.5em;
    font-weight: 600;
    letter-spacing: 3px;
}

#clock-date {
    font-size: 1.5em;
    letter-spacing: 1px;
}

header, main, footer, .profile-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ... (其余样式保持不变) ... */
article {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 30px; /* 增加了文章之间的间距 */
}

article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.article-title {
    color: #1a1a1a;
    cursor: pointer;
    transition: color .3s;
}

.article-title:hover {
    color: #007bff;
}

.article-content {
    max-height: 0;
    overflow: hidden;
    margin-top: 0; /* 折叠时移除上边距 */
    transition: max-height 0.4s ease-in-out, margin-top 0.4s ease-in-out;
}

.article-content.expanded {
    margin-top: 15px; /* 展开时恢复上边距 */
    max-height: 1000px; /* 一个足够大的值以显示所有内容 */
}

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

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .15);
}

.profile-name {
    margin-top: 8px;
    margin-bottom: 5px;
    font-size: 1.8em;
}

.profile-tech-stack {
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
    letter-spacing: 1px;
}

.profile-signature {
    font-size: 1em;
    color: #666;
}

/* 音乐播放器入口按钮样式 */
.music-entry-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.music-entry-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.article-image,
.article-video {
    max-width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Set initial state for animations to prevent flashing */
.fade-in,
.slide-in {
    opacity: 0;
}

.fade-in {
    animation: fadeInAnimation 1s ease-in-out forwards;
}

.slide-in {
    animation: slideInAnimation 1s ease-in-out forwards;
}

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

@keyframes slideInAnimation {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

footer {
    text-align: center;
    margin-top: 40px;
    font-size: .9em;
    color: #666;
}

/* 特别鸣谢样式 */
.special-thanks {
    margin-top: 10px;
    font-size: 0.8em;
    color: #888;
}

.special-thanks a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

.special-thanks a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 侧边栏切换按钮 */
#sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#sidebar-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

#sidebar-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#sidebar-toggle.open span:nth-child(2) {
    opacity: 0;
}

#sidebar-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    right: -250px; /* 初始隐藏 */
    width: 220px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: right 0.4s ease-in-out;
    overflow-y: auto;
}

.sidebar.open {
    right: 0; /* 点击后显示 */
}

.sidebar h3 {
    margin-top: 0;
    color: #1a1a1a;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s;
}

.sidebar ul li a:hover {
    color: #0056b3;
}