/* Variables for consistency - Easily change colors and spacing */
:root {
    --primary-color: #0056b3; /* Strong blue for main highlights and links */
    --secondary-color: #007bff; /* Lighter blue for active states/links */
    --accent-color: #28a745; /* Green for 'live' status */
    --text-color: #333; /* Dark text for readability */
    --light-text-color: #f8f9fa; /* Light text for dark backgrounds */
    --light-bg: #f4f7fa; /* Light background for content areas */
    --dark-bg: #343a40; /* Dark background for header/footer */
    --border-color: #dee2e6; /* Light border color */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
}

/* Basic Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased; /* Improve text rendering on macOS/iOS */
    -moz-osx-font-smoothing: grayscale; /* Improve text rendering on macOS/iOS */
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease; /* Smooth color transition on hover */
}

a:hover {
    color: var(--primary-color);
    text-decoration: none; /* Keep links without underline on hover, unless specified */
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle; /* Align images better in text */
}

ul {
    list-style: none; /* Remove default list bullets */
}

/* Layout Utilities - Centralizes content and adds padding */
.layout-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px; /* Maximum width for main content */
    margin: 0 auto; /* Center the layout */
    padding: 0 var(--spacing-md); /* Horizontal padding */
}

/* Header Styles */
.site-header {
    background-color: var(--dark-bg);
    color: var(--light-text-color);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.brand-logo img {
    height: 40px; /* Adjust logo size */
    object-fit: contain; /* Ensure logo fits within dimensions */
}

.main-nav ul {
    display: flex;
}

.main-nav .nav-item {
    margin-left: var(--spacing-xl);
    position: relative;
}

.main-nav .nav-item a {
    color: var(--light-text-color);
    font-weight: 500;
    padding: var(--spacing-sm) 0;
    display: block;
    transition: color 0.3s ease;
}

.main-nav .nav-item a:hover {
    color: var(--secondary-color);
}

.main-nav .nav-item.active a {
    color: var(--secondary-color);
    text-decoration: none;
}

.main-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px; /* Position of the active indicator */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* Main Content Body */
.content-body {
    display: flex;
    max-width: 1200px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
    align-items: flex-start; /* Align content to the top */
    gap: var(--spacing-xl); /* Space between flex items (if more columns) */
}

.left-content {
    flex: 1; /* Allows it to take up available space */
    min-width: 0; /* Prevents overflow issues in flex container */
}

/* Schedule Section */
.schedule-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* More pronounced shadow */
    overflow: hidden; /* Ensures border-radius is applied to children */
}

.section-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background-color: #f8f9fa; /* Slightly off-white background */
}

.section-header img {
    width: 32px;
    height: 32px;
    margin-right: var(--spacing-sm);
}

.section-header h2 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 600;
}

.section-body {
    padding: var(--spacing-lg);
}

.schedule-list {
    display: grid;
    gap: var(--spacing-xl); /* Space between daily boxes */
}

.daily-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.daily-title {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: bold;
    font-size: 18px;
    text-align: center;
}

.daily-title p {
    margin: 0; /* Remove default paragraph margin */
}

/* Game Item */
.game-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.game-item:last-child {
    border-bottom: none; /* No border for the last item in a daily box */
}

.game-item:hover {
    background-color: #f0f4f7; /* Light hover background */
    cursor: pointer;
}

.time-league {
    flex: 0 0 150px; /* Fixed width for time and league on desktop */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
}

.match-time {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary-color);
}

.league-name {
    color: #6c757d; /* Muted color for league name */
}

.team-info {
    flex-grow: 1; /* Allows team info to take up remaining space */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-align: center;
}

.home-team, .away-team {
    flex: 1; /* Each team takes half of the team-info space */
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

.home-team {
    justify-content: flex-end; /* Align home team details to the right */
    text-align: right;
    padding-right: var(--spacing-sm);
}
.away-team {
    justify-content: flex-start; /* Align away team details to the left */
    text-align: left;
    padding-left: var(--spacing-sm);
}

.home-side, .away-side {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.home-side img, .away-side img {
    width: 32px; /* Team logo size */
    height: 32px;
    object-fit: contain;
}
.away-side { /* Reverse order for away team image/name */
    flex-direction: row-reverse;
}

.vs-label {
    font-weight: bold;
    color: #6c757d;
    font-size: 18px;
    flex-shrink: 0; /* Prevent "vs" from shrinking */
}

.live-status {
    flex: 0 0 100px; /* Fixed width for status on desktop */
    text-align: center;
    font-weight: bold;
    font-size: 15px;
}

.live-status a {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    background-color: #6c757d; /* Default for '即将开始' or '已结束' */
    color: var(--light-text-color);
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
}

.live-status.begin a {
    background-color: var(--accent-color); /* Green for '直播中' */
    animation: pulse 1.5s infinite; /* Pulsing effect for live */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.live-status a:hover {
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--light-text-color);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    font-size: 14px;
}

.footer-container {
    flex-direction: column; /* Stack items vertically in footer */
    text-align: center;
    gap: var(--spacing-md);
}

.footer-info .disclaimer {
    max-width: 900px;
    margin-bottom: var(--spacing-sm);
    color: rgba(255,255,255,0.7); /* Lighter disclaimer text */
}

.footer-info .copyright {
    color: rgba(255,255,255,0.8); /* Slightly lighter copyright text */
}

.footer-info a {
    color: var(--secondary-color);
}

/* Responsive Adjustments */

/* Hamburger Menu styles - hidden on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative;
    z-index: 100; /* Ensure it's above other content if needed */
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--light-text-color);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* Hamburger transform when active */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* For screens smaller than 992px (e.g., larger tablets, small laptops) */
@media (max-width: 992px) {
    .main-nav .nav-item {
        margin-left: var(--spacing-lg);
    }
    .game-item {
        flex-wrap: wrap; /* Allow items to wrap to next line */
        justify-content: center;
        text-align: center;
    }

    .time-league {
        flex: 1 1 100%; /* Take full width */
        margin-bottom: var(--spacing-sm);
    }

    .team-info {
        flex-basis: 100%; /* Take full width */
        margin-bottom: var(--spacing-sm);
        gap: var(--spacing-lg); /* More space between home/away teams */
    }
    .home-team, .away-team {
        justify-content: center; /* Center team info within its flex item */
        padding: 0; /* Remove specific padding for alignment */
    }
    .home-side, .away-side {
        flex-direction: column; /* Stack image and name vertically */
        align-items: center;
        gap: var(--spacing-xs); /* Smaller gap for stacked elements */
    }
    .away-side { /* Revert direction for stacked layout */
        flex-direction: column;
    }

    .live-status {
        flex: 1 1 100%; /* Take full width */
        margin-top: var(--spacing-sm);
    }
}

/* For screens smaller than 768px (e.g., tablets, larger phones) */
@media (max-width: 768px) {
    .site-header .layout-flex {
        /* On mobile, align logo left, hamburger right */
        justify-content: space-between;
        align-items: center;
        padding: 0 var(--spacing-md);
        position: relative; /* For absolute positioning of main-nav */
    }

    .brand-logo {
        flex-grow: 1; /* Allow logo to take up space */
    }

    .main-nav {
        display: none; /* Hide nav by default on mobile */
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        width: 100%;
        background-color: var(--dark-bg); /* Use dark background for menu */
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        z-index: 90; /* Ensure it's below hamburger but above content */
        transform: translateY(-100%); /* Start hidden above */
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    }

    .main-nav.is-open {
        display: block; /* Show nav when 'is-open' class is added */
        transform: translateY(0); /* Slide down */
        opacity: 1;
    }

    .main-nav ul.nav-list {
        flex-direction: column; /* Stack nav items vertically when menu is open */
        align-items: stretch; /* Stretch items to full width */
        padding: var(--spacing-md) 0;
    }
    .main-nav .nav-item {
        margin: 0; /* Reset margins */
        border-bottom: 1px solid rgba(255,255,255,0.1); /* Add a separator between items */
    }
    .main-nav .nav-item:last-child {
        border-bottom: none; /* No border for the last item */
    }
    .main-nav .nav-item a {
        padding: var(--spacing-sm) var(--spacing-xl); /* Add horizontal padding for touch targets */
        text-align: center; /* Center text in each item */
    }
    /* Hide the PC style active indicator for mobile */
    .main-nav .nav-item.active::after {
        display: none;
    }
    /* Mobile active item styling: use a background color instead of underline */
    .main-nav .nav-item.active a {
        background-color: var(--primary-color); /* Highlight active item with primary color */
        border-radius: 0; /* Remove border-radius for full-width items */
    }

    .menu-toggle {
        display: block; /* Show hamburger button on mobile */
    }

    .content-body {
        flex-direction: column; /* Stack main content sections */
        padding: 0 var(--spacing-sm); /* Reduce horizontal padding */
    }
    .section-header h2 {
        font-size: 20px;
    }
    .section-body {
        padding: var(--spacing-md);
    }
    .daily-title {
        font-size: 16px;
    }
    .game-item {
        padding: var(--spacing-sm); /* Reduce game item padding */
    }
    .match-time {
        font-size: 16px;
    }
    .league-name {
        font-size: 13px;
    }
    .home-team span, .away-team span {
        font-size: 15px;
    }
    .vs-label {
        font-size: 16px;
    }
    .live-status a {
        font-size: 14px;
        padding: var(--spacing-xs) var(--spacing-md);
    }
}

/* For screens smaller than 480px (e.g., small phones) */
@media (max-width: 480px) {
    .brand-logo img {
        height: 35px;
    }
    .section-header h2 {
        font-size: 18px;
    }
    .home-side img, .away-side img {
        width: 28px;
        height: 28px;
    }
    .home-team span, .away-team span {
        font-size: 14px;
    }
    .footer-info .disclaimer {
        font-size: 12px;
    }
    .footer-info .copyright {
        font-size: 12px;
    }
}










/* Global Resets & Defaults */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    margin: 0;
    background-color: #f0f2f5; /* Light gray background */
    color: #333;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes bottom space */
}

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

/* Layout */
.layout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.page-path-container {
    margin-bottom: 20px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.page-path {
    font-size: 0.9em;
    color: #666;
}
.page-path span {
    color: #333;
    font-weight: 500;
}

.main-content-area {
    display: flex;
    gap: 20px;
}

.content-main {
    flex: 3; /* Takes up 3 parts of the space */
    min-width: 0; /* Prevents overflow in flex items */
}

.content-side {
    flex: 1; /* Takes up 1 part of the space */
    min-width: 0;
}

/* Card Styling */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px; /* For consistency if stacked on mobile */
}

.section-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}
.section-header img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}
.section-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.section-inner {
    padding: 20px;
}

/* Score Section */
.score-wrap {
    padding: 10px 0; /* Reduced padding as section-inner handles it */
}
.score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}
.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%; /* Adjust as needed */
}
.team-logo img {
    width: 60px; /* Adjust size */
    height: 60px;
    object-fit: contain; /* Prevents distortion */
    margin-bottom: 8px;
    border-radius: 50%; /* Circular logos */
    background-color: #f8f9fa; /* Light bg for transparent images */
    padding: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.team-name {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.score-info {
    width: 40%; /* Adjust as needed */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.league-info {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
}
.league-info .league-name {
    font-weight: 500;
}
.league-info .match-time {
    margin-left: 8px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.score-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #17a2b8; /* A distinct color for score */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.score-value .score-home, .score-value .score-away {
    min-width: 30px; /* Ensure space for '?' or scores */
}
.score-value .score-separator {
    margin: 0 10px;
}

.status-indicator {
    font-size: 0.9em;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    background-color: #e9ecef;
    color: #495057;
    margin: 0;
}
.status-indicator:empty { display: none; } /* Hide if JS fails or no status */
/* Dynamic status colors (optional, via JS or server-side class) */
.status-indicator.live { background-color: #28a745; color: white; }
.status-indicator.not-started { background-color: #ffc107; color: #212529; }
.status-indicator.finished { background-color: #6c757d; color: white; }


/* Stream Section */
.stream-section {
    margin-top: 20px;
}
.stream-title {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #343a40;
}
.stream-title img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}
.stream-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.stream-links li {
    flex-grow: 1; /* Allow items to grow */
}
.stream-links .live-link {
    display: block;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    text-align: center;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.stream-links .live-link:hover {
    background-color: #0056b3;
    text-decoration: none;
}

/* Match Description */
.match-description p {
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #495057;
}
.match-description p:last-child {
    margin-bottom: 0;
}
.match-description p span:first-child {
    font-weight: 500;
    color: #343a40;
    margin-right: 5px;
}
.match-description .highlight {
    font-weight: 500;
    color: #17a2b8; /* Match highlight color with score */
}


/* Hot Streams (Sidebar) */
.hot-streams-list { /* Renamed from section-inner ul for clarity */
    /* section-inner already provides padding */
}
.hot-stream-item {
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden; /* For rounded corners on link wrapper */
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s ease;
}
.hot-stream-item:last-child {
    margin-bottom: 0;
}
.hot-stream-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hot-stream-link-wrapper {
    display: block;
    color: inherit; /* Inherit text color from body */
}
.hot-stream-link-wrapper:hover {
    text-decoration: none;
}

.hot-stream-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    font-size: 0.85em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}
.hot-stream-league {
    font-weight: 500;
    color: #495057;
}
.hot-stream-time {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.hot-stream-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
}
.hot-stream-team {
    display: flex;
    flex-direction: column; /* Stack image and name */
    align-items: center;
    text-align: center;
    font-size: 0.9em;
    flex-basis: 40%; /* Give teams some base width */
}
.hot-stream-team img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 5px;
    border-radius: 50%;
    background-color: #fff; /* Ensure bg for transparent team logos */
}
.hot-stream-team span {
    color: #343a40;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%; /* For text-overflow to work */
}

.hot-stream-vs {
    font-size: 0.9em;
    font-weight: bold;
    color: #adb5bd;
    flex-basis: 10%;
    text-align: center;
}

.hot-stream-action {
    display: flex;
    justify-content: space-between; /* Push text and arrow apart */
    align-items: center;
    background-color: #007bff;
    color: white;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 500;
}
.hot-stream-action .arrow {
    font-size: 1.2em;
    line-height: 1;
}

/* Responsive Adjustments */
@media (max-width: 991px) { /* Tablets and large phones */
    .main-content-area {
        flex-direction: column;
    }
    .content-main, .content-side {
        flex: none; /* Reset flex grow/shrink */
        width: 100%;
    }
    .team { width: 28%; } /* Slightly adjust for more score space */
    .score-info { width: 44%; }
}

@media (max-width: 767px) { /* Mobile phones */
    .layout-wrapper {
        padding: 15px 10px;
    }
    .page-path-container {
        padding: 8px 12px;
        margin-bottom: 15px;
    }
    .section-header {
        padding: 12px 15px;
    }
    .section-header h2 { font-size: 1.1em; }
    .section-inner {
        padding: 15px;
    }

    .score-header {
        flex-wrap: wrap; /* Allow wrapping if too narrow */
        justify-content: center; /* Center items when wrapped */
    }
    .team {
        width: 45%; /* Teams take more relative width */
        margin-bottom: 10px; /* Space if score-info wraps below */
    }
    .team-logo img { width: 50px; height: 50px; }
    .team-name { font-size: 1em; }
    
    .score-info {
        width: 100%; /* Full width when it wraps or on its own line */
        order: -1; /* Move score info to the top on mobile if teams wrap */
        margin-bottom: 15px;
    }
    .league-info { font-size: 0.85em; }
    .score-value { font-size: 2em; }
    .status-indicator { font-size: 0.85em; }

    /* Adjust stream links for better tap targets */
    .stream-links ul {
        flex-direction: column; /* Stack links vertically */
        gap: 8px;
    }
    .stream-links li {
        width: 100%; /* Full width links */
    }

    .match-description p { font-size: 0.9em; }

    .hot-stream-team { font-size: 0.85em; }
    .hot-stream-team img { width: 32px; height: 32px; }
}

@media (max-width: 480px) { /* Smaller mobile screens */
    .team {
        width: 100%; /* Stack teams fully */
    }
    .team:first-of-type {
        margin-bottom: 10px;
    }
    .score-info {
        order: 0; /* Reset order if teams are fully stacked */
        margin-top: 10px;
        margin-bottom: 10px;
    }
    .team-logo img { width: 45px; height: 45px; }
    .score-value { font-size: 1.8em; }

    .hot-stream-body {
        padding: 10px;
    }
    .hot-stream-team img { width: 28px; height: 28px; }
    .hot-stream-vs { font-size: 0.8em; }
}

/* Lazy load placeholder */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
img.lazy[src] { /* When src is set by JS */
    opacity: 1;
}