/* Modal Styles */
.modal {
    display: flex; 
    visibility: hidden;
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal.closing .modal-content {
    animation: modalSlideOut 0.3s ease forwards;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

/* 只有在显示时才应用进入动画，避免初始加载或关闭时触发 */
.modal.show .modal-content {
    animation: modalSlideIn 0.4s ease;
}

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

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

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    z-index: 1010;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* About Container Layout */
.about-container {
    display: flex;
    flex: 1;
    height: calc(100% - 60px); /* Reserve space for nav buttons */
    overflow: hidden;
}

.about-sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #eee;
    overflow-y: auto;
    padding: 15px;
}

.about-main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    background-color: #fff;
}

/* Sidebar Items */
.about-sidebar .info-section {
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border: 1px solid transparent;
}

.about-sidebar .info-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.about-sidebar .active-item {
    background: linear-gradient(90deg, #3a95e4, #4aa0e8);
    color: #fff;
    box-shadow: 0 4px 10px rgba(58, 149, 228, 0.3);
}

/* Content Items */
.about-content-item {
    display: none;
    animation: fadeIn 0.5s ease;
}

.about-content-item.active-content {
    display: block;
}

.info-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #3a95e4;
    padding-bottom: 10px;
    display: inline-block;
}

.info-content {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

/* Navigation Buttons */
.modal-nav-buttons {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background-color: #3a95e4;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.modal-btn:hover {
    background-color: #2a85d4;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.modal-btn.btn-disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.close-modal-btn-mobile {
    display: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .about-container {
        flex-direction: column;
    }
    
    .about-sidebar {
        width: 100%;
        height: 60px; /* Show a few items */
        border-right: none;
        border-bottom: 1px solid #eee;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .about-sidebar .info-section {
        min-width: 120px;
        margin-right: 10px;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        height: 100%;
        font-size: 12px; /* Smaller font for mobile */
        padding: 5px;
        white-space: nowrap; /* Prevent text wrapping */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .modal-content {
        width: 95%;
        height: 90vh;
        max-height: 90vh; /* Ensure it doesn't exceed viewport */
    }

    .about-main-content {
        padding: 15px; /* Reduce padding on mobile */
    }

    .info-title {
        font-size: 20px; /* Smaller title on mobile */
    }

    .info-content {
        font-size: 14px; /* Smaller content on mobile */
    }

    /* 移动端关闭按钮优化 */
    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 32px;
        padding: 10px; /* 增大点击区域 */
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        color: #333;
    }

    /* 移动端底部关闭按钮 */
    .close-modal-btn-mobile {
        display: block !important;
        background-color: #f8f9fa;
        color: #666;
        border: 1px solid #ddd;
    }
}
