/* Videos Page Specific Styles */

.container {
    grid-template-columns: 2.5fr auto 7.5fr;
    align-items: start;
}

.intro-box {
    background-color: #447593;
    color: #CFD9E3;
    font-size: 1.8rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    line-height: 1.2;
    width: fit-content;
    margin-bottom: 1rem;
}

.intro-box a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s;
}

.intro-box a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.left-section {
    display: flex;
    flex-direction: column;
    padding-right: 1rem;
    position: sticky;
    top: 7rem;
    height: calc(100vh - 9rem);
    overflow-y: auto;
    padding-bottom: 3rem;
}

.left-section .intro-box {
    color: #17223F;
    font-size: 8rem;
    font-weight: 900;
    padding: 0;
    line-height: 1;
    background-color: transparent;
}

.divider {
    width: 1px;
    background-color: #17223F;
    height: auto;
    align-self: stretch;
    opacity: 0.6;
}

.right-section {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    height: auto;
    overflow: visible;
    padding-bottom: 3rem;
}

.right-section .intro-box:not(:first-child) {
    margin-top: 3rem;
}

.support-note {
    line-height: 1.8;
    color: #17223F;
    font-size: 1.1rem;
    margin-top: auto;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #17223F;
    transition: opacity 0.3s ease;
}

.social-icons a:hover {
    opacity: 0.7;
}

.social-icons svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Accordion Styles */
.video-accordion {
    width: 100%;
    border-top: 1px solid rgba(23, 34, 63, 0.2);
}

.video-item {
    border-bottom: 1px solid rgba(23, 34, 63, 0.2);
    overflow: hidden;
}

.video-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Add this to separate items */
    padding: 1.5rem 0;
    cursor: pointer;
    list-style: none; /* Remove default triangle */
    transition: background-color 0.2s;
    user-select: none;
}

.video-header::-webkit-details-marker {
    display: none; /* Remove default triangle in WebKit */
}

.video-header:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.video-id {
    font-family: 'Noto Serif SC', serif;
    font-weight: 900;
    font-size: 2.6rem;
    color: #17223F;
    min-width: 6rem;
    opacity: 0.3; /* Adjusted from 0.8 to 0.3 for a lighter appearance */
    transition: opacity 0.3s ease, color 0.3s ease;
}

details[open] .video-id {
    opacity: 0.8;
    color: #447593;
}

.video-title {
    font-size: 2.8rem;
    color: #333;
    font-weight: 600;
    text-align: right; /* Right align the title */
    transition: color 0.3s ease;
}

details[open] .video-title {
    color: #447593;
}

/* Video Content Layout */
.video-content {
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
    background-color: transparent;
}

.video-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    width: 100%;
}

.video-text-content {
    flex: 1;
    margin-right: 0;
}

.video-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Meta Tag Styling */
.meta-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0;
    color: #fff;
}

.meta-updated {
    background-color: transparent;
    color: #888;
    padding-left: 0;
    font-weight: normal;
    font-size: 0.85rem;
}

.meta-line {
    flex-grow: 1; /* Extend to fill remaining space */
    height: 0;
    border-top: 2px dotted #ccc; /* Dotted line */
    margin-left: 0.5rem;
    min-width: 3rem; /* Ensure at least some dots are visible */
    opacity: 0.6;
}

body.dark-mode .meta-line {
    border-top-color: #555;
}

body.dark-mode .meta-updated {
    color: #aaa;
}

.status-completed {
    background-color: #4CAF50; /* Green */
}

.status-ongoing {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.status-irregular {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.meta-episodes {
    color: #666;
    font-size: 0.9rem;
}

.video-description {
    text-align: left;
    max-width: 100%;
    line-height: 1.7;
    color: #444;
    margin-bottom: 0;
}

.video-links-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 280px;
    align-items: stretch;
}

.link-category-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.link-category-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right; /* Default align right for desktop */
    font-weight: 600;
}

.link-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Unified Link Card Styles */
.unified-link-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.2rem;
    background-color: #f9f9f9; /* Dimmer background for light mode */
    min-width: 0; /* Allow shrinking in grid */
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically if card is tall */
    height: 100%; /* Match height of neighbors */
}

.card-header {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.link-row {
    display: flex;
    align-items: center;
}

.link-type-label {
    font-size: 0.9rem;
    color: #666;
    margin-right: 0.8rem;
    min-width: 3.5em; 
}

.link-icons-inline {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.inline-icon {
    width: 28px;
    height: 28px;
    color: #888;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inline-icon:hover {
    color: #17223F;
    transform: translateY(-2px);
}

.inline-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Dark Mode Styles for Unified Card */
body.dark-mode .unified-link-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-header {
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .link-type-label {
    color: #aaa;
}

body.dark-mode .inline-icon {
    color: #ccc;
}

body.dark-mode .inline-icon:hover {
    color: #fff;
}

.video-media-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    align-items: stretch;
}

.video-grid {
    display: none; /* Hide old grid if it exists */
}

.feature-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative; /* Added for absolute positioning of play icon */
    height: 100%;
}

.play-icon-overlay {
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
    width: 2.2rem;
    height: 2.2rem;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer; /* Enable cursor */
    backdrop-filter: blur(2px);
    transition: background-color 0.3s;
    text-decoration: none; /* Remove underline for link */
}

.feature-item:hover .play-icon-overlay {
    background-color: rgba(23, 34, 63, 0.8); /* Darker blue on hover */
}

.play-icon-overlay svg {
    width: 50%;
    height: 50%;
    fill: currentColor;
}

.feature-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: block;
    transition: transform 0.3s ease;
}

.feature-tag {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 3px;
    color: #fff;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.feature-tag.recommend {
    background-color: rgba(255, 126, 95, 0.9); /* Warm orange-red for recommend */
}

.feature-tag.latest {
    background-color: rgba(74, 144, 226, 0.9); /* Blue for latest */
}

.feature-item img:hover {
    transform: translateY(-4px);
}

.feature-item figcaption {
    font-size: 0.95rem;
    color: #555;
    text-align: center;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* 手机端适配 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr !important;
        padding: 0 1.5rem;
        gap: 0.8rem;
    }

    .divider {
        display: block;
        width: 100%;
        height: 1px;
        background-color: rgba(23, 34, 63, 0.15);
        margin: 0;
    }
    
    .left-section {
        position: static;
        height: auto;
        padding: 0;
        margin-top: 1rem;
    }

    .left-section .intro-box {
        font-size: 4rem;
        margin-bottom: 0.5rem;
    }

    .right-section {
        padding: 0;
    }

    .video-info {
        flex-direction: column;
        gap: 1.5rem;
    }

    .video-text-content {
        margin-right: 0;
        width: 100%;
    }

    .video-media-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .video-title {
        font-size: 1.8rem;
    }

    .video-id {
        font-size: 1.8rem;
        min-width: 4rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 0.3rem;
    }

    .video-media-row {
        grid-template-columns: repeat(2, 1fr); /* 视频封面较宽，手机端建议先保持2列，或者尝试3列 */
        gap: 0.5rem;
    }

    .unified-link-card {
        grid-column: span 2; /* 链接卡片占满一行 */
    }

    .video-title {
        font-size: 1.4rem;
    }

    .video-id {
        font-size: 1.4rem;
        min-width: 3rem;
    }

    .video-header {
        padding: 1rem 0;
    }
}

/* Dark Mode Styles */
body.dark-mode .intro-box {
    background-color: #447593;
    color: #e0e0e0;
}

body.dark-mode .left-section .intro-box {
    background-color: transparent;
    color: #DFDFD9;
}

body.dark-mode .divider {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .support-note {
    color: #DFDFD9;
}

body.dark-mode .social-icons a {
    color: #DFDFD9;
}

/* Dark Mode Accordion */
body.dark-mode .video-accordion {
    border-top-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .video-item {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .video-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .video-id {
    color: #DFDFD9;
    opacity: 0.3;
}

body.dark-mode details[open] .video-id {
    color: #80cbc4;
    opacity: 0.8;
}

body.dark-mode .video-title {
    color: #e0e0e0;
}

body.dark-mode details[open] .video-title {
    color: #80cbc4;
}

body.dark-mode .video-description {
    color: #ccc;
}

body.dark-mode .feature-item img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0.9;
}

body.dark-mode .feature-item figcaption {
    color: #aaa;
}

body.dark-mode .status-completed {
    background-color: rgba(0, 105, 92, 0.2);
    color: #80cbc4;
    border-color: rgba(128, 203, 196, 0.3);
}

body.dark-mode .status-ongoing {
    background-color: rgba(230, 81, 0, 0.2);
    color: #ffcc80;
    border-color: rgba(255, 204, 128, 0.3);
}

body.dark-mode .status-irregular {
    background-color: rgba(123, 31, 162, 0.2);
    color: #ce93d8;
    border-color: rgba(206, 147, 216, 0.3);
}

body.dark-mode .meta-episodes {
    color: #999;
}

body.dark-mode .video-icon {
    color: #aaa;
}

body.dark-mode .video-icon:hover {
    color: #e0e0e0;
}
