html, body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background: transparent;
    cursor: url('Resources/common/PointingCursor.png') 1 1, auto;
}

/* Global active state for all elements */
*:active {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, auto;
}

/* Dragging state for all elements */
*:active:focus,
*:active:focus-visible,
*:active:focus-within {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, auto;
}

/* Override drag cursors for links and images */
a[draggable="true"],
img[draggable="true"],
a:active,
img:active {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, auto !important;
}

/* Prevent default drag behavior and use custom cursor */
a, img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Ensure all interactive elements use PinchCursor */
button, input, select, textarea, [role="button"], [tabindex] {
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
}

button:active, input:active, select:active, textarea:active, [role="button"]:active, [tabindex]:active {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, pointer;
}

header {
    color: #333;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    text-align: center;
}

header .image-container {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
    overflow: hidden;
    line-height: 0;
}

header .image-container video,
header .image-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    min-height: 240px;
    object-fit: cover;
    object-position: center;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

main {
    padding: 2rem;
    max-width: var(--section-max-width, 960px);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

main section {
    display: block;
    margin: 1.25rem auto 0;
    padding: 2rem 2rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    text-align: justify;
    background: var(--glass-bg, rgba(255, 255, 255, 0.55));
    backdrop-filter: var(--glass-blur, blur(16px) saturate(100%));
    -webkit-backdrop-filter: var(--glass-blur, blur(16px) saturate(100%));
    border: var(--glass-border-width, 1px) solid var(--glass-border, rgba(0, 0, 0, 0.1));
    border-radius: var(--glass-radius, 16px);
    box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.07)),
        var(--glass-inset, inset 0 1px 0 rgba(255, 255, 255, 0.5));
    color: var(--text-secondary, #555);
}

main section:first-of-type {
    margin-top: 0;
}

/* Contact holds the fixed social bar — no glass panel (backdrop-filter breaks position: fixed) */
main section#contact {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: 1.5rem;
    overflow: visible;
}

main section#contact .social-media {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--glass-bg-strong, rgba(255, 255, 255, 0.72));
    backdrop-filter: var(--glass-blur, blur(16px) saturate(100%));
    -webkit-backdrop-filter: var(--glass-blur, blur(16px) saturate(100%));
    border: var(--glass-border-width, 1px) solid var(--glass-border, rgba(0, 0, 0, 0.1));
    padding: 12px;
    border-radius: var(--glass-radius, 16px);
    box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.07)),
        var(--glass-inset, inset 0 1px 0 rgba(255, 255, 255, 0.5));
    z-index: 1000;
    align-items: center;
}

main section h1 {
    color: var(--text-primary, #333);
}

main section h2 {
    font-size: 1.8rem;
    color: var(--text-primary, #333);
    border-bottom: var(--glass-border-width, 1px) solid var(--glass-border, rgba(0, 0, 0, 0.1));
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* Remove dividing line when h2 is immediately followed by image/video container */
main section h2:has(+ .image-container),
main section h2:has(+ .image-row) {
    border-bottom: none;
    padding-bottom: 0;
}

main section h3 {
    font-size: 1.5rem;
    color: var(--text-primary, #333);
    border-bottom: var(--glass-border-width, 1px) solid var(--glass-border, rgba(0, 0, 0, 0.1));
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

main section h4 {
    font-size: 1.2rem;
    color: var(--text-primary, #333);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

main section p,
main section ul {
    font-size: 1rem;
    margin-bottom: 1rem;
    max-width: 100%;
}

main section img,
main section video {
    max-width: 100%;
    height: auto;
}

main section .image-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

main section .image-container video,
main section .image-container img,
main section .image-row {
    max-width: 100%;
    box-sizing: border-box;
}

main section .image-row img {
    border-radius: calc(var(--glass-radius, 16px) - 4px);
}

main section iframe {
    max-width: 100%;
}

main section .store-cards {
    max-width: 100%;
    flex-wrap: wrap;
}

/* Article content: inline code, figures, and tables */
main section code {
    font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 0.875em;
    background: rgba(127, 127, 127, 0.14);
    border-radius: 5px;
    padding: 0.1em 0.35em;
    white-space: nowrap;
}

main section .article-figure {
    margin: 1.5rem 0;
    text-align: center;
}

main section .article-figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

main section .figure-grid {
    display: grid;
    gap: 16px;
    margin: 1.5rem 0;
}

main section .figure-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

main section .figure-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

main section .figure-grid--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

main section .figure-grid figure {
    margin: 0;
    text-align: center;
}

main section .figure-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

main section .figure-grid figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-secondary, #777);
}

main section .table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

main section .article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: center;
}

main section .article-table th,
main section .article-table td {
    border: 1px solid var(--glass-border, rgba(127, 127, 127, 0.25));
    padding: 0.75rem 0.6rem;
    vertical-align: middle;
}

main section .article-table th {
    background: rgba(127, 127, 127, 0.1);
    font-weight: 600;
}

main section .article-table td img {
    width: 90px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    box-sizing: border-box;
}

main section .article-table--kinds td img {
    width: 100%;
    max-width: 140px;
}

main section .figure-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

main section .article-video {
    margin: 1.5rem 0;
    text-align: center;
}

main section .article-video video {
    width: 100%;
    max-width: 720px;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    main section .figure-grid--4,
    main section .figure-grid--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Store Cards (Project Pages) */
.store-cards {
    margin-top: 1.5rem;
    display: flex;
    gap: 12px;
    width: 100%;
}

.store-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: #dcdcdc;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
}

.store-card:active {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, pointer;
}

.store-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #000;
    color: #fff;
    border-radius: 10px;
}

.store-card__content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.store-card__eyebrow {
    font-size: 12px;
    color: #666;
}

.store-card__title {
    font-size: 16px;
    font-weight: 600;
}

.store-card__meta {
    font-size: 12px;
    color: #888;
}

.dark-mode .store-card {
    background: rgba(26,26,26,0.7) !important;
    border-color: #333 !important;
}

.dark-mode .store-card__eyebrow,
.dark-mode .store-card__meta {
    color: #aaa !important;
}

ul {

    list-style-type: disc;
    padding-left: 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* Simple image rows to place multiple images on the same line */

.image-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.image-row > * {
    flex: 1 1 0;
}

/* Enforce a tidy, consistent presentation */
.image-row img {
    width: 100%;
    height: 320px; /* equal height for images in the same row */
    object-fit: cover; /* clip to fill without distortion */
    display: block;
}

/* Variant: keep full image visible (no cropping) while matching row height */
.image-row--contain img {
    object-fit: contain;
    background-color: #f5f5f5; /* subtle letterbox background */
}

@media (max-width: 768px) {
    .image-row {
        flex-direction: column;
    }
    .image-row img {
        height: auto; /* let images size naturally when stacked */
    }
}

/* Specific styling for white-backgrounded diagram images in WFP pages */
.dark-mode img[src*="XRInteractionFramework.png"],
.dark-mode img[src*="WorkFlowOfXRInteraction.png"] {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.2);
}

/* Clickable diagram images */
img[src*="XRInteractionFramework.png"],
img[src*="WorkFlowOfXRInteraction.png"] {
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

img[src*="XRInteractionFramework.png"]:hover,
img[src*="WorkFlowOfXRInteraction.png"]:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    overscroll-behavior: contain;
}

.modal-container {
    position: absolute;
    top: 50px;
    left: 50px;
    right: 50px;
    bottom: 50px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: url('Resources/common/PinchCursor.png') 1 1, zoom-in;
    border: none;
    outline: none;
    display: block;
}

.modal-content.zoomed {
    cursor: url('Resources/common/PinchCursor.png') 1 1, zoom-out !important;
    transform: scale(1.5) !important;
    transform-origin: top left !important;
    width: auto !important;
    height: auto !important;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ccc;
}

/* Dark mode modal styles */
.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.95);
}

.dark-mode .modal-content {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.2);
}


/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 1.25rem;
    }

    main section {
        padding: 1.5rem 1.25rem;
    }

    nav.top-nav ul {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    nav.top-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    nav.top-nav ul li {
        margin-left: 0;
        margin-bottom: 10px;
    }

    h3 {
        text-align: left;
        /* Center the heading */
        font-size: 36px;
        /* Larger font size for the heading */
        margin-bottom: 20px;
        /* Add space below the heading */
        color: #333;
        /* Darker color for the heading */
        border-bottom: 1px solid #ccc; /* Add a subtle border between items */
    }

    h4 {
        text-align: left;
        /* Center the heading */
        font-size: 36px;
        /* Larger font size for the heading */
        margin-bottom: 20px;
        /* Add space below the heading */
        color: #333;
        /* Darker color for the heading */
        border-bottom: 1px solid #ccc; /* Add a subtle border between items */
    }


}
/* Dark Mode Styles for Project Pages */
.dark-mode {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    color: #ffffff !important;
}

.dark-mode main section {
    color: var(--text-secondary, #b0b0b0) !important;
}

.dark-mode main section h1,
.dark-mode main section h2,
.dark-mode main section h3,
.dark-mode main section h4 {
    color: var(--text-primary, #ffffff) !important;
}

.dark-mode main section h2 {
    border-bottom: var(--glass-border-width, 1px) solid var(--glass-border, rgba(255, 255, 255, 0.12)) !important;
}

/* Dark mode: Remove dividing line when h2 is immediately followed by image/video container */
.dark-mode main section h2:has(+ .image-container),
.dark-mode main section h2:has(+ .image-row) {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.dark-mode main section h3 {
    border-bottom: var(--glass-border-width, 1px) solid var(--glass-border, rgba(255, 255, 255, 0.12)) !important;
}

.dark-mode section h2 {
    color: #ffffff !important;
    border-bottom: 1px solid #444 !important;
}

/* Dark mode: Remove dividing line when h2 is immediately followed by image/video container */
.dark-mode section h2:has(+ .image-container),
.dark-mode section h2:has(+ .image-row) {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.dark-mode section h3 {
    color: #ffffff !important;
    border-bottom: 1px solid #444 !important;
}

.dark-mode section h4 {
    color: #ffffff !important;
}

.dark-mode nav.top-nav {
    background-color: rgba(26, 26, 26, 0.8) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.dark-mode nav.top-nav ul li a {
    color: #e0e0e0 !important;
}

.dark-mode nav.top-nav ul li a:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08);
}

.dark-mode main section#contact .social-media {
    background-color: var(--glass-bg-strong, rgba(48, 48, 48, 0.78)) !important;
    box-shadow: var(--glass-shadow, 0 4px 24px rgba(0, 0, 0, 0.35)) !important;
}

.dark-mode .social-media {
    background-color: rgba(26, 26, 26, 0.8) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.dark-mode .social-media a {
    color: #e0e0e0 !important;
}

.dark-mode .social-media a:hover {
    color: #1e88e5 !important; /* Unified blue hover color */
}

.dark-mode footer {
    background: none !important;
    border: none !important;
    color: var(--text-secondary) !important;
}

/* Dark Mode Toggle Button */
#darkModeToggle {
    background: none;
    border: 2px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
    font-size: 16px;
}

#darkModeToggle:hover {
    border-color: #1e88e5;
color: #1e88e5;
    transform: scale(1.1);
}

.dark-mode #darkModeToggle {
    border-color: #e0e0e0;
    color: #e0e0e0;
}

.dark-mode #darkModeToggle:hover {
    border-color: #1e88e5;
    color: #1e88e5;
}

/* Work in Progress section dark mode */
.dark-mode #work-in-progress div {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    color: #e0e0e0 !important;
}

.dark-mode #work-in-progress h2 {
    color: #ffffff !important;
}

.dark-mode #work-in-progress p {
    color: #bdc3c7 !important;
/* Dark Mode Button Positioning - Top Right Corner for Project Pages */
.dark-mode-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}



#darkModeToggle {
    background: none;
    border: 2px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#darkModeToggle:hover {
    border-color: #1e88e5;
    color: #1e88e5;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode #darkModeToggle {
    border-color: #e0e0e0;
    color: #e0e0e0;
    background-color: rgba(26, 26, 26, 0.8);
}

.dark-mode #darkModeToggle:hover {
    border-color: #9bc4f5;
    color: #9bc4f5;
    background-color: rgba(26, 26, 26, 0.9);
}

/* Remove old dark mode button styles from nav */
nav.top-nav #darkModeToggle {
    position: static;
    margin: 0;
}

/* Updated Dark Mode Button - Smaller and No Outline for Project Pages */
.dark-mode-toggle-container #darkModeToggle {
    background: none;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle-container #darkModeToggle:hover {
    color: #1e88e5;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode .dark-mode-toggle-container #darkModeToggle {
    color: #e0e0e0;
    background-color: rgba(26, 26, 26, 0.8);
}

.dark-mode .dark-mode-toggle-container #darkModeToggle:hover {
    color: #1e88e5;
    background-color: rgba(26, 26, 26, 0.9);
}

/* Highlight text for important content on project pages */
.highlight-text {
    color: #1e88e5; /* Brighter blue for better visibility in light mode */
}

.dark-mode .highlight-text {
    color: #a0d0ff; /* Brighter blue for dark mode */
}

/* Info text styling on project pages */
.info-text {
    color: #1e88e5; /* Brighter blue for better visibility in light mode */
}

.dark-mode .info-text {
    color: #a0d0ff; /* Brighter blue for dark mode */
}

/* Base link colors on project pages */
a {
    color: #1e88e5; /* Brighter blue for better visibility in light mode */
}

a:hover {
    color: #1e4a8c; /* Darker blue on hover */
}

.dark-mode a {
    color: #a0d0ff; /* Brighter blue for dark mode */
}

.dark-mode a:hover {
    color: #1e88e5; /* Unified blue hover color */
}

/* Navigation links cursor styling */
nav.top-nav ul li a {
    cursor: pointer;
    transition: color 0.3s ease;
}

nav.top-nav ul li a:hover {
    cursor: pointer;
}

/* Social media links cursor styling */
.social-media a {
    cursor: pointer;
    transition: color 0.3s ease;
}

.social-media a:hover {
    cursor: pointer;
}

/* Text links cursor styling */
a {
    cursor: pointer;
}

a:hover {
    cursor: pointer;
}

/* Specific styling for blue text links */
a[style*="color: #007bff"] {
    cursor: pointer;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a[style*="color: #007bff"]:hover {
    cursor: pointer;
    color: #0056b3 !important;
    text-decoration: underline !important;
}

/* Playlist button link styling */
a[href*="bilibili.com/391939640/lists/3555538"] {
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    transition: transform 0.2s ease;
}

a[href*="bilibili.com/391939640/lists/3555538"]:hover {
    cursor: url('Resources/common/PinchCursor.png') 1 1, pointer;
    transform: translateY(-2px);
}

a[href*="bilibili.com/391939640/lists/3555538"]:active {
    cursor: url('Resources/common/PinchedCursor.png') 1 1, pointer;
}










}