/* ==========================================================================
   OVERRIDES & FIXES
   (Applied separately to ensure priority and avoid encoding issues)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CURSOR RESET (Revert to System Default)
   -------------------------------------------------------------------------- */
html,
body,
* {
    cursor: auto !important;
}

/* Hide any custom cursor elements that might be generated */
.cursor-glow,
.cursor-glow-inner {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Ensure interactive elements show the standard pointer hand */
a,
button,
.btn,
.project-card,
.award-card,
.link-card,
summary,
input[type='submit'],
[role='button'] {
    cursor: pointer !important;
}

/* --------------------------------------------------------------------------
   2. NAVIGATION FIXES (Remove Outline)
   -------------------------------------------------------------------------- */
nav a:focus,
nav a:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   3. MOBILE LAYOUT FIXES
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* Projects and Awards Grids - Keep Single Column */
    .projects-grid,
    .awards-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        gap: 24px !important;
    }

    /* Quick Links Grid - Responsive (Generally 2 columns) */
    .links-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        width: 100% !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
        gap: 16px !important;
    }

    /* Cards should fill the width */
    .project-card,
    .award-card,
    .link-card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    /* Force Profile/Info section to stack vertically */
    .profile-content,
    .info-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Skills grid usually looks better as 1 column on mobile too */
    .info .skills-grid {
        grid-template-columns: 1fr !important;
    }

    /* Ensure no horizontal overflow */
    main,
    section {
        overflow-x: hidden !important;
    }

    /* 
     * 4. NAVIGATION FIXES - MOBILE SPECIFIC
     * 强制在移动端禁用 hover/focus 触发的下划线，防止点击后状态残留
     * 只有 .active 类才能触发下划线 
     */
    nav a:not(.active):hover::after,
    nav a:not(.active):focus::after {
        width: 0 !important;
        opacity: 0 !important;
    }

    /* 确保 active 状态下划线可见 */
    nav a.active::after {
        width: 100% !important;
        opacity: 1 !important;
    }
}
