/* Hub Layout Styles for Parents and Evaluation Centers */

:root {
    --card-radius: 24px;
    --primary-color: #22b18c;
    --soft-shadow: 0 4px 20px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.02);
    --hover-shadow: 0 20px 40px rgba(34, 177, 140, 0.12), 0 8px 16px rgba(0,0,0,0.04);
}

.portfolio-section {
    background-color: #f8fafc;
    background-image: radial-gradient(#22b18c 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    background-attachment: fixed;
    position: relative;
    padding: 40px 0;
    z-index: 0; /* 明确基础层级 */
}

.portfolio-section > .container {
    position: relative;
    z-index: 5; /* 提升到更高层级，确保完全在所有背景和叠加层之上 */
}

/* 强制清除可能影响文字清晰度的滤镜 */
.portfolio-section * {
    filter: none !important;
    backdrop-filter: none !important;
}

.portfolio-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 1) 100%);
    pointer-events: none;
    z-index: 1; /* 位于背景之上，内容之下 */
}

.portfolio-section h2.text-center {
    margin-bottom: 0.5rem !important;
}

/* --- Completed Status Design - Elegant Right Ribbon --- */
.completed-badge {
    display: none;
    position: absolute;
    top: 20px;
    right: 0;
    background: rgba(4, 124, 207, 0.7); /* Theme Blue with 70% opacity */
    color: white;
    padding: 4px 12px 4px 16px;
    border-radius: 20px 0 0 20px;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: -2px 4px 8px rgba(4, 124, 207, 0.2);
    z-index: 10;
    animation: badgeSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.medal-icon {
    font-size: 1.1rem;
    line-height: 1;
    margin-right: 2px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

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

.portfolio-card.compact-card.is-completed .completed-badge,
.portfolio-card.compact-card.is-in-progress .completed-badge { display: flex; }
.portfolio-card.compact-card.is-completed .card-accent-dot { display: none; }
.portfolio-card.compact-card.is-completed { 
    border-color: rgba(16, 185, 129, 0.2);
    background: #f8faf9;
}

/* CTA Button States for Hubs */
.portfolio-card.compact-card.is-completed .card-cta-btn {
    background: #f1f5f9 !important;
    color: #64748b !important;
    justify-content: space-between;
}

.portfolio-card.compact-card.is-completed .card-cta-btn span {
    display: none;
}
.portfolio-card.compact-card.is-completed .card-cta-btn i {
    display: inline-block;
    order: 2;
}

.portfolio-card.compact-card.is-completed:hover .card-cta-btn {
    background: #047ccf !important;
    color: #fff !important;
    transform: scale(1.02);
}

/* --- Privacy Notice Collapsible --- */
.privacy-notice-wrapper {
    max-width: 800px;
    width: 95%;
    cursor: pointer;
    padding: 10px 20px;
    background: #fff;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(4, 124, 207, 0.1);
    display: flex;
    align-items: center;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.privacy-notice-wrapper:hover {
    background: #fcfdfe;
    border-color: rgba(4, 124, 207, 0.3);
    box-shadow: 0 6px 16px rgba(4, 124, 207, 0.08);
}
.notice-content {
    flex: 1;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
    font-size: 0.88rem;
    color: #334155 !important; /* 恢复正常深色 (Slate 700) */
    font-weight: 400 !important;
    transition: all 0.3s ease;
}
.privacy-notice-wrapper.expanded {
    border-radius: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
}
.privacy-notice-wrapper.expanded .notice-content {
    white-space: normal;
    overflow: visible;
    line-height: 1.5;
}
.privacy-notice-wrapper:not(.expanded) br {
    display: none;
}
.privacy-notice-wrapper:not(.expanded) .notice-content {
    max-height: 1.5em;
}
.toggle-hint {
    color: #047ccf;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 500;
    white-space: nowrap;
}
.text3-link {
    color: #047ccf;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9; /* 稍微降低链接的饱和感 */
}
.text3-link:hover {
    text-decoration: underline;
}
.privacy-notice-wrapper.expanded .toggle-hint {
    margin-left: 0;
    margin-top: 8px;
    text-align: right;
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
}

/* --- Card Design --- */
.portfolio-card.compact-card {
    background: linear-gradient(180deg, #ffffff 0%, #edf7f4 100%);
    border-radius: var(--card-radius);
    border: 1px solid rgba(34, 177, 140, 0.2);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 25px rgba(23, 135, 106, 0.1), 0 2px 4px rgba(0,0,0,0.02);
    overflow: hidden;
}

.portfolio-card.compact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(34, 177, 140, 0.15), 0 10px 20px rgba(0,0,0,0.05);
    border-color: rgba(34, 177, 140, 0.3);
}

.card-accent-dot {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0;
    opacity: 1;
}

.portfolio-card.compact-card.is-completed .card-accent-dot { display: block; height: 4px; opacity: 0.3; }

.portfolio-card.compact-card .portfolio-info {
    padding: 24px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-top-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f8fafc;
}

.category-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #1e293b;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.portfolio-card.compact-card:hover .category-badge {
    background: var(--wb-green-tint);
    color: var(--primary-color);
}

.time-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #f1f5f9;
}

.portfolio-card.compact-card h5 {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.portfolio-card.compact-card h5 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.portfolio-card.compact-card:hover h5 a {
    color: var(--primary-color);
}

.portfolio-card.compact-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1e293b;
    margin-bottom: 24px;
    flex-grow: 1;
    font-weight: 400;
}

.card-cta-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #eefaf6 0%, #e6f7f2 100%);
    color: #22b18c;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(34, 177, 140, 0.1);
}

.portfolio-card.compact-card:hover .card-cta-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a9d7c 100%);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(34, 177, 140, 0.2);
    border-color: transparent;
}

.card-cta-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.portfolio-card.compact-card:hover .card-cta-btn i {
    transform: translateX(5px);
}

/* --- Filter Buttons --- */
.filter-container {
    display: flex;
    justify-content: center;
    margin-bottom: -20px;
    position: relative;
    z-index: 10;
}

.filter-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #fff;
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(226, 232, 240, 0.6);
    gap: 6px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: #1e293b;
    padding: 6px 16px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--wb-green-tint);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff !important;
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 25px 0;
    }
    .breadcrumb {
        margin-bottom: 0;
        font-size: 0.8rem;
    }
    .privacy-notice-wrapper {
        padding: 6px 12px;
        border-radius: 20px;
    }
    /* Control notice vs filters distance */
    .text-center.mb-3.mb-md-5.fade-in,
    .text-center.mb-3.mb-md-3.fade-in {
        margin-bottom: 20px !important;
    }
    .notice-content {
        font-size: 0.75rem;
    }
    .toggle-hint {
        font-size: 0.7rem;
    }
    
    .mb-4.text-center.text-primary {
        margin-bottom: 0.8rem !important;
        font-size: 1.4rem;
    }
    
    .filter-container {
        margin-bottom: 5px;
    }
    .filter-buttons { 
        padding: 2px; 
        margin-bottom: 10px;
        gap: 5px;
    }
    .filter-btn { 
        padding: 6px 12px; 
        font-size: 0.75rem; 
    }
    
    .portfolio-card.compact-card .portfolio-info {
        padding: 12px 10px;
    }
    .portfolio-card.compact-card h5 {
        font-size: 0.9rem;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .portfolio-card.compact-card p {
        font-size: 0.75rem;
        margin-bottom: 6px;
        line-height: 1.3;
        color: #334155;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .card-top-meta {
        gap: 6px;
        margin-bottom: 6px;
        flex-wrap: wrap;
        padding-bottom: 6px;
    }
    .category-badge {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }
    .time-badge {
        display: none;
    }
    .card-cta-btn {
        width: auto;
        display: inline-flex;
        padding: 1px 8px;
        font-size: 0.6rem;
        border-radius: 8px;
        background: linear-gradient(135deg, #eefaf6 0%, #e6f7f2 100%);
        margin: 0 auto;
        font-weight: 700;
        min-height: 20px;
        align-items: center;
    }
    .card-cta-btn span {
        margin-right: 3px;
    }
    .card-cta-btn i {
        font-size: 0.75rem;
    }
    /* 保持移动端文字视觉清晰 */
    .text-muted, .notice-content {
        color: #334155 !important; /* 统一使用深色 */
        font-weight: 400 !important;
    }
    .completed-badge {
        padding: 3px 8px 3px 12px;
        font-size: 0.7rem;
        top: 10px;
    }
    .medal-icon {
        font-size: 0.9rem;
    }
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    /* Double column for mobile hubs */
    .col-lg-3.col-md-6.portfolio-item,
    .col-lg-4.col-md-6.portfolio-item {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .row.g-3.gx-md-2.gy-md-1 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 0.5rem !important;
    }
    .portfolio-item {
        margin-bottom: 0 !important;
    }
}