/* CSS Reset and Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa; /* A very light grey background */
    color: #343a40;
}

/* Top Navigation Bar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px; /* Define navbar height */
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.navbar-container {
    display: flex;
    align-items: baseline;
    gap: 15px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Announcement Bar Styles */
#announcement-bar {
    position: fixed;
    top: 64px; /* Position below the navbar */
    left: 0;
    width: 100%;
    background-color: #fffbe6; /* Light yellow background */
    color: #856404;
    padding: 10px 0;
    z-index: 999;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid #ffeeba;
}

.announcement-content {
    display: inline-block;
    padding-left: 100%; /* Start scrolling from the right */
    animation: scroll-left 30s linear infinite;
}

.announcement-content span {
    margin-right: 50px; /* Space between announcements */
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Main wrapper for the entire page layout */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 114px 20px 80px; /* Adjusted top padding for navbar + announcement bar */
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles & Logo Section are now part of the navbar */

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
}

.subtitle {
    font-size: 16px;
    color: #6c757d;
}

/* Main content grid layout */
.main-content {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 320px 1fr; /* Fixed width for left column */
    gap: 30px;
}

/* Left column */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* General card styles */
.card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
}

.card-content {
    flex-grow: 1;
    font-size: 14px;
    color: #495057;
    line-height: 1.7;
}

/* About Me Section Styles */
.about-me-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-image: url('assets/tx.avif');
    background-size: cover;
    background-position: center;
    margin-bottom: 20px;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.nickname {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 10px;
}

.bio {
    font-size: 14px;
    color: #6c757d;
}

/* Contact Section Styles */
.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: #e9ecef; /* Light grey background */
    color: #343a40; /* Darker text */
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
    border: none; /* Removed border for a flatter look */
}

.social-link:hover {
    background-color: #dee2e6; /* Slightly darker on hover */
}

.donation-container h4 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.donation-img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
}

.donation-text {
    font-size: 12px;
    color: #868e96;
    margin-top: 10px;
}

/* Works Section Notice Styles */
.works-notice {
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f1f3f5;
    border-radius: 8px;
}

.works-notice p {
    font-size: 13px;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.works-notice .notice-legal {
    font-size: 11px;
    color: #868e96;
    margin-top: 5px;
}

/* Works Section Styles */
.works-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.work-card {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.work-card:hover {
     transform: translateY(-2px);
     box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

.work-card.disabled {
    cursor: not-allowed;
}

.work-card.disabled::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background-color: rgba(255, 82, 82, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 2;
    text-align: center;
}

.work-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.work-details {
    flex-grow: 1;
}

.work-title {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 4px;
}

.work-description {
    font-size: 14px;
    color: #6c757d;
}

.work-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: #ffc107;
    color: #212529;
    margin-left: 15px;
    white-space: nowrap;
}

/* Friends Section Styles */
.friends-list-container {
    display: grid;
    /* 创建一个响应式的列布局，每列最小320px，最大1fr */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.friend-card {
    display: flex;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* 增加圆角以匹配整体风格 */
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.friend-card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0; /* 防止图片被压缩 */
    object-fit: cover; /* 保证图片不变形 */
    background-color: #f0f0f0; /* 图片加载失败时的背景色 */
}

.friend-card-info {
    display: flex;
    flex-direction: column;
    padding: 15px;
    flex-grow: 1;
    justify-content: center;
    overflow: hidden;
}

.friend-card-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eeeeee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-card-description {
    font-size: 0.9em;
    color: #555;
    margin: 0;
    padding-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f8f9fa;
    text-align: center;
    padding: 15px 0;
    color: #6c757d;
    font-size: 14px;
    border-top: 1px solid #e9ecef;
    z-index: 100;
}

.footer span::after {
    content: '|';
    margin: 0 15px;
    color: #ced4da;
}

.footer a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #343a40;
}

/* Modal Styles */
.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.6); /* Darker overlay */
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #ffffff; /* Changed from #fefefe */
    margin: 8% auto; /* Adjusted margin */
    padding: 30px; /* Increased padding */
    border: none; /* Removed border */
    width: 90%;
    max-width: 700px; /* Increased max-width */
    border-radius: 16px; /* Larger border-radius */
    position: relative;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2); /* Softer, deeper shadow */
}

/* Styles for Important Announcement Modal */
.modal-content.important {
    border-left: 5px solid #f5c6cb; /* Red accent for importance */
}

.modal-content.important h2 {
    color: #721c24; /* Dark red title */
}

/* Styles for AD Announcement Modal */
.modal-content.ad {
    padding: 0;
    overflow: hidden;
    text-align: left;
}

.ad-modal-image-container {
    width: 100%;
}

.modal-content.ad img {
    width: 100%;
    display: block;
    margin-bottom: 0;
}

.ad-modal-text-container {
    padding: 25px 30px;
    border-top: 1px solid #e9ecef;
}

.ad-modal-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.nav-button {
    background-color: #e9ecef;
    border: none;
    color: #343a40;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.nav-button:hover {
    background-color: #dee2e6;
}

.nav-button:disabled {
    background-color: #f1f3f5;
    color: #ced4da;
    cursor: not-allowed;
}

#ad-counter {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.modal-content.ad h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #212529;
}

.modal-content.ad p {
    font-size: 16px;
    color: #495057;
    line-height: 1.7;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close-button {
    color: #868e96; /* Softer color */
    position: absolute;
    top: 15px;
    right: 25px; /* Adjusted position */
    font-size: 32px; /* Slightly larger */
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease; /* Added transition */
    z-index: 10; /* Ensure it's on top */
}

.close-button:hover,
.close-button:focus {
    color: #495057; /* Darker on hover */
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px; /* Increased margin */
    font-weight: 700; /* Bolder */
    font-size: 24px; /* Larger font size */
    color: #343a40;
}

/* Timeline Styles */
.timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px; /* Thinner line */
    background-color: #ffc107; /* Orange line */
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Staggered animation for timeline items */
.timeline-item:nth-child(odd) {
    animation-delay: 0.1s;
}
.timeline-item:nth-child(even) {
    animation-delay: 0.2s;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 18px; /* Slightly larger node */
    height: 18px; /* Slightly larger node */
    background-color: white;
    border: 4px solid #ffc107;
    top: 24px;
    border-radius: 50%;
    z-index: 1;
    transition: background-color 0.3s ease; /* Added transition */
}

.timeline-item:hover::after {
    background-color: #ffc107; /* Highlight on hover */
}

.timeline-item.left::after {
    right: -11px; /* Adjusted position */
}

.timeline-item.right::after {
    left: -11px; /* Adjusted position */
}

.timeline-content {
    padding: 20px; /* Increased padding */
    background-color: #f8f9fa;
    border-radius: 10px; /* Smoother corners */
    border: 1px solid #e9ecef;
    position: relative; /* Needed for the arrow */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* Arrow for timeline content */
.timeline-content::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    border: medium solid #e9ecef;
}

.timeline-item.left .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #e9ecef;
}

.timeline-item.right .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent #e9ecef transparent transparent;
}


.timeline-content h3 {
    font-size: 18px; /* Larger title */
    font-weight: 600;
    margin-bottom: 10px; /* Increased margin */
    color: #343a40;
}

.timeline-content p {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 114px 15px 80px;
    }
    .logo-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* 加载状态和错误状态样式 */
.loading, .error {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.error {
    color: #dc3545;
}

/* 协议页面样式 */
.agreement-card {
    max-width: 100%;
    margin: 0 auto;
}

.agreement-content {
    padding: 20px;
}

.agreement-content h1 {
    color: #212529;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.agreement-content h2 {
    color: #495057;
    margin: 25px 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.agreement-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #6c757d;
    text-align: justify;
}

.agreement-content ul {
    margin: 15px 0 15px 20px;
    padding-left: 10px;
}

.agreement-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .agreement-card {
        margin: 0;
    }
    
    .agreement-content {
        padding: 15px;
    }
    
    .agreement-content h1 {
        font-size: 24px;
    }
    
    .agreement-content h2 {
        font-size: 20px;
    }
}
.new-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 10px;
    z-index: 10;
    transform: rotate(5deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 确保timeline-content容器有相对定位，使角标位置正确 */
.timeline-content {
    position: relative;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}