/* ========================================
   Bento Grid Portfolio - Style System
   Creative & Modern Design for 2025
   ======================================== */

/* --- Font Imports --- */
/* Performance: Reduced to two weights (Regular + Bold) to save bandwidth. SemiBold removed. */
@font-face {
    font-family: 'Noto Serif SC';
    src: url('https://static.tian14.com/fonts/NotoSerifSC-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Noto Serif SC';
    src: url('https://static.tian14.com/fonts/NotoSerifSC-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* --- CSS Variables --- */
:root {
    /* Colors - Light Mode */
    --bg-color: #FFFFFF;
    --bg-noise: none;
    --card-bg: #FFFFFF;
    --text-main: #000000;
    --text-muted: #555555; /* Slightly softer for contrast */
    --text-light: #888888;

    /* Primary Gradient - Restored for Content */
    --primary-start: #ff758c; /* Vibrant Pink */
    --primary-end: #ff7eb3; /* Soft Rose */
    --primary-gradient: linear-gradient(135deg, var(--primary-start), var(--primary-end));

    /* Shadows - Removed */
    --card-shadow: none;
    --card-hover-shadow: none;
    --nav-shadow: none;

    /* Layout */
    --border-radius: 0;
    --border-radius-sm: 0;
    --gap: clamp(16px, 2vw, 24px);
    --max-width: 1200px;

    /* Typography */
    --font-primary: 'Noto Serif SC', serif;
    
    /* Borders for B&W theme */
    /* Borders for B&W theme */
}

body.dark-mode {
    --bg-color: #000000;
    --card-bg: #000000;
    --text-main: #FFFFFF;
    --text-muted: #CCCCCC;
    --text-light: #AAAAAA;
    --card-shadow: none;
    --card-hover-shadow: none;
    --nav-shadow: none;
    
    --nav-shadow: none;

    /* Ambient Background Colors - Dark Mode */
    --blob-color-1: transparent;
    --blob-color-2: transparent;
    --blob-color-3: transparent;
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    background-image: var(--bg-noise);
    color: var(--text-main);
    line-height: 1.6;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Animated Grain Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-noise);
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
    animation: grain-animation 8s steps(10) infinite;
}

@keyframes grain-animation {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* --- Ambient Background System - Removed --- */
.ambient-background {
    display: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation-iteration-count: infinite;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    transform: translate3d(0, 0, 0); /* Force hardware acceleration */
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 70vw;
    height: 70vw;
    background: var(--blob-color-1);
    animation: moveBlob1 20s infinite alternate;
    transition: background 1s ease;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--blob-color-2);
    animation: moveBlob2 25s infinite alternate-reverse;
    transition: background 1s ease;
}

.blob-3 {
    bottom: 20%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: var(--blob-color-3);
    animation: moveBlob3 22s infinite alternate;
    transition: background 1s ease;
    opacity: 0.5;
}

@keyframes moveBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20vw, 10vh) scale(1.1); }
}

@keyframes moveBlob2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20vw, -15vh) rotate(20deg); }
}

@keyframes moveBlob3 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15vw, -20vh) scale(0.9); }
    100% { transform: translate(-10vw, 15vh) scale(1.1); }
}

/* --- Loading Overlay (Removed for performance) --- */

/* --- Floating Navigation --- */
.floating-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    justify-content: space-between;
}

body.dark-mode .floating-nav {
    background: rgba(20, 20, 20, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 6px 12px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-start);
    background: rgba(108, 92, 231, 0.1);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    --magnet-x: 0px;
    --magnet-y: 0px;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translate(var(--magnet-x), var(--magnet-y)) rotate(15deg);
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-toggle .fa-sun { display: none; }
body.dark-mode .theme-toggle .fa-moon { display: none; }
body.dark-mode .theme-toggle .fa-sun { display: block; }

/* --- Bento Grid Container --- */
.bento-container {
    max-width: var(--max-width);
    margin: 100px auto 40px;
    padding: 0 clamp(16px, 3vw, 24px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--gap);
}

/* --- Bento Card Base --- */
.bento-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: clamp(20px, 3vw, 32px);
    box-shadow: none;
    border: 2px solid var(--text-main); /* Ensure visible border */
    
    /* Removed 3D transform */
    transform: none;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
    z-index: 2;
}

/* Weather card: no scale on hover, only shadow */
.weather-card-v2:hover {
    transform: none;
}

/* Support for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bento-card {
        transition: none;
    }
    .bento-card:hover {
        transform: none;
    }
    .stat-card,
    .learning-card {
        animation: none;
        background-position: 0% 50%;
    }
    .stat-icon {
        animation: none;
    }
    .quote-text {
        transition: none;
    }
    .refresh-btn {
        transform: none !important;
    }
}

/* --- Hero Card (2x2) --- */
.hero-card {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(32px, 5vw, 48px);
}

/* Decorative gradient lines */
.hero-card::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-start), transparent);
    opacity: 0.5;
    z-index: 0;
    display: none; /* Hide decorative lines */
}

.hero-card::after {
    display: none; /* Hide decorative lines */
}

.card-deco-blob {
    display: none; /* Hide colored blob */
    z-index: 0;
}


body.dark-mode .card-deco-blob {
    opacity: 0.2;
}

.card-content {
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary-start);
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

#hero-title {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.4;
    margin: 16px 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary-start); /* Fallback */
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Hero Stats Chips */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--text-main);
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

body.dark-mode .chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.chip:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--primary-start);
    color: var(--primary-start);
    transform: translateY(-2px);
}

.chip i {
    font-size: 0.75rem;
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    --magnet-x: 0px;
    --magnet-y: 0px;
}

.btn-pill.primary {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: none;
}

.btn-pill.primary:hover {
    transform: translate(var(--magnet-x), calc(var(--magnet-y) - 2px));
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-pill.ghost {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text-main);
}

body.dark-mode .btn-pill.ghost {
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-pill.ghost:hover {
    background: rgba(108, 92, 231, 0.08);
    border-color: var(--primary-start);
    color: var(--primary-start);
    transform: translate(var(--magnet-x), calc(var(--magnet-y) - 2px));
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.2);
}

/* Focus styles for keyboard navigation */
.btn-pill:focus-visible {
    outline: 2px solid var(--primary-start);
    outline-offset: 3px;
}

.btn-pill.ghost:focus-visible {
    outline: 2px solid var(--primary-start);
    outline-offset: 2px;
    background: rgba(108, 92, 231, 0.05);
}

/* --- Profile Card (1x2) --- */
.profile-card {
    grid-column: span 2;
    grid-row: span 2;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    margin: 0 auto 16px;
    border-radius: 0;
    overflow: hidden;
    border: none;
    box-shadow: none;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.profile-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.social-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-row a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s ease;
    --magnet-x: 0px;
    --magnet-y: 0px;
}

body.dark-mode .social-row a {
    background: rgba(255, 255, 255, 0.05);
}

.social-row a:hover {
    background: var(--text-main);
    color: var(--bg-color);
    transform: translate(var(--magnet-x), calc(var(--magnet-y) - 3px));
}

.social-row a:hover i {
    color: var(--bg-color);
}

body.dark-mode .social-row a:hover {
    background: #FFFFFF;
    color: #000000;
}

body.dark-mode .social-row a:hover i {
    color: #000000;
}

.book-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    text-align: left; /* FORCE LEFT ALIGNMENT */
    align-items: flex-start; /* Ensure flex children align left */
}

/* --- Weather Card V2 --- */
.weather-card-v2 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    color: #333;
    transition: background 0.5s ease, color 0.5s ease;
    padding: clamp(16px, 2.5vw, 20px) !important;
    padding-top: 25px !important;
    z-index: 1; /* Establish stacking context */
    object-fit: cover;
}

.weather-bg-effect {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Hide all effects by default */
.effect-group {
    display: none;
    width: 100%;
    height: 100%;
    left: 0;
    pointer-events: none;
}

.weather-card-v2.is-sunny .sunny-effect,
.weather-card-v2.is-rainy .rainy-effect,
.weather-card-v2.is-snowy .snowy-effect,
.weather-card-v2.is-windy .windy-effect {
    display: block;
}

/* Weather Animations Keyframes */
@keyframes sun-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rain-fall {
    0% { transform: translateY(-20px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(150px); opacity: 0; }
}

@keyframes snow-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(150px) rotate(360deg); opacity: 0; }
}

@keyframes cloud-float {
    0% { transform: translateX(-10px); opacity: 0.5; }
    50% { transform: translateX(10px); opacity: 0.8; }
    100% { transform: translateX(-10px); opacity: 0.5; }
}

/* Sunny Elements */
.sun-core {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.4), transparent 70%);
    border-radius: 50%;
    animation: sun-spin 20s linear infinite;
}

.sun-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 0, 0.5), transparent);
    transform-origin: center;
}
.sun-ray.ray-1 { transform: translate(-50%, -50%) rotate(0deg); }
.sun-ray.ray-2 { transform: translate(-50%, -50%) rotate(45deg); }
.sun-ray.ray-3 { transform: translate(-50%, -50%) rotate(90deg); }
.sun-ray.ray-4 { transform: translate(-50%, -50%) rotate(135deg); }

/* Rainy Elements */
.rain-drop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: rgba(174, 194, 224, 0.6);
    top: -20px;
    animation: rain-fall 1s linear infinite;
}
.rain-drop.d1 { left: 10%; animation-delay: 0s; animation-duration: 0.8s; }
.rain-drop.d2 { left: 20%; animation-delay: 0.5s; animation-duration: 1.2s; }
.rain-drop.d3 { left: 40%; animation-delay: 0.2s; animation-duration: 0.9s; }
.rain-drop.d4 { left: 60%; animation-delay: 0.7s; animation-duration: 1.1s; }
.rain-drop.d5 { left: 80%; animation-delay: 0.3s; animation-duration: 1.3s; }

/* Snowy Elements */
.snow-flake {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    top: -10px;
    filter: blur(1px);
    animation: snow-fall 3s linear infinite;
}
.snow-flake.s1 { left: 15%; animation-delay: 0s; }
.snow-flake.s2 { left: 35%; animation-delay: 1.5s; }
.snow-flake.s3 { left: 55%; animation-delay: 0.8s; }
.snow-flake.s4 { left: 75%; animation-delay: 2.2s; }

/* Windy Elements */
.wind-cloud {
    position: absolute;
    width: 60px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    filter: blur(5px);
    animation: cloud-float 4s ease-in-out infinite;
}
.wind-cloud.c1 { top: 20px; left: 20px; }
.wind-cloud.c2 { top: 60px; right: 30px; animation-delay: 1s; }


.weather-header, .weather-body, .weather-footer {
    position: relative;
    z-index: 2;
}

.weather-header {
    display: flex;
    justify-content: flex-start;
}

.condition-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.weather-body {
    display: flex;
    flex-direction: column;
    position: relative;
    position: relative;
    margin-top: 25px;
}

.temp-wrapper {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.temp-unit {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    vertical-align: top;
    margin-left: 2px;
    opacity: 0.8;
}

.location-text {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.location-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.weather-main-icon {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(5rem, 8vw, 7rem); /* Larger icon */
    opacity: 0.2;
    z-index: -1;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
    transition: all 0.5s ease;
}

.weather-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15); /* Glassmorphism base */
    border-top: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 12px;
    margin-top: 10px;
}

.weather-card-v2 .stat-label {
    color: inherit;
    opacity: 0.9;
    font-weight: 500;
}

.weather-footer .stat-box:nth-child(3) {
    grid-column: span 2;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
}

/* --- 5. Stats Card (Experience) - Minimal Style --- */
.stat-card {
    /* Removed specific background/border to inherit glassmorphism */
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Subtle Blue Glow on Hover */
.stat-card:hover {
    box-shadow: 0 10px 40px -10px rgba(67, 203, 255, 0.25);
    border-color: rgba(67, 203, 255, 0.3);
}

.stat-icon {
    position: relative;
    font-size: 3rem;
    color: #43CBFF; /* Bright Blue Icon */
    margin-bottom: 12px;
    transition: transform 0.3s ease;
    pointer-events: auto;
    right: auto;
    bottom: auto;
    transform: none;
    opacity: 1;
}

.stat-card:hover .stat-icon {
    transform: translateY(-5px) scale(1.1);
}

.stat-number {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0;
    background: linear-gradient(135deg, #43CBFF 0%, #9708CC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 2;
    text-shadow: none;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    z-index: 2;
    opacity: 1;
}

/* Dynamic Themes */
/* Neutralized Weather Themes for B&W */
.weather-card-v2.is-sunny,
.weather-card-v2.is-rainy,
.weather-card-v2.is-snowy,
.weather-card-v2.is-windy {
    background: var(--card-bg);
    color: var(--text-main);
}

.weather-card-v2.is-sunny .weather-main-icon,
.weather-card-v2.is-rainy .weather-main-icon,
.weather-card-v2.is-snowy .weather-main-icon,
.weather-card-v2.is-windy .weather-main-icon {
    color: var(--text-main);
    opacity: 0.2;
    mix-blend-mode: normal;
    transform: translateY(-50%);
}

.weather-card-v2.is-sunny .weather-bg-effect,
.weather-card-v2.is-rainy .weather-bg-effect,
.weather-card-v2.is-snowy .weather-bg-effect,
.weather-card-v2.is-windy .weather-bg-effect {
    display: none;
}

.weather-card-v2.is-rainy .condition-badge,
.weather-card-v2.is-snowy .condition-badge,
.weather-card-v2.is-windy .condition-badge {
    background: transparent;
    border-color: var(--text-main);
    color: var(--text-main);
}

.weather-card-v2.is-rainy .weather-footer,
.weather-card-v2.is-snowy .weather-footer {
    background: transparent;
    color: var(--text-main);
}

/* Hide DOM effects */
.sun-core, .sun-ray, .wind-cloud, .wind-line, .rain-drop, .snow-flake {
    display: none !important;
}

/* --- Quote Card (1x1) --- */
.quote-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg);
    border: 2px solid var(--text-main);
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.quote-card::before {
    display: none;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
}

.quote-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.refresh-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    opacity: 0.7;
    transition: all 0.3s ease;
    border-radius: 0;
}


.refresh-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(var(--magnet-x), var(--magnet-y)) rotate(180deg);
}

.refresh-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.quote-content-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.quote-text {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    color: var(--text-main);
    transition: opacity 0.3s ease;
}

.quote-text.fade-out {
    opacity: 0;
}

.quote-footer {
    text-align: right;
    position: relative;
    z-index: 1;
    margin-top: 10px;
}

.quote-author {
    font-size: 0.8rem;
    opacity: 0.85;
    font-style: italic;
    color: var(--text-main);
}

.quote-author::before {
    content: '— ';
    opacity: 0.6;
}

/* --- About Card (2x1) --- */
.about-card {
    grid-column: span 2;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--text-main);
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.about-card p {
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.7;
}

.quote {
    font-style: italic;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 16px;
}

/* --- Skills Card (2x auto) --- */
.skills-card {
    grid-column: span 2;
    /* 移除固定行数，让高度自适应内容 */
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.skill-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: transparent;
    border-radius: 0;
    border: 1px solid var(--text-main);
    transition: all 0.3s ease;
    cursor: default;
}

body.dark-mode .skill-tag {
    background: transparent;
}

.skill-tag:hover {
    background: var(--skill-color);
    border-color: var(--skill-color);
    transform: translateY(-2px);
}

body.dark-mode .skill-tag:hover {
    background: var(--skill-color);
    border-color: var(--skill-color);
}

.skill-tag i {
    font-size: 2rem;
    color: var(--skill-color);
    transition: all 0.3s ease;
}

.skill-tag:hover i {
    color: #FFFFFF;
    transform: none;
}

.skill-tag:hover span {
    color: #FFFFFF;
}

.skill-tag span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

/* --- Stats Card (1x1) --- */
.stat-card {
    text-align: center;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--text-main); /* Border for B&W */
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    display: none;
}

.stat-card::after {
    display: none;
}


.stat-card > * {
    position: relative;
    z-index: 1;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 1;
    color: var(--text-main);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: none;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.3;
}

/* --- Learning Now Card (1x1) --- */
.learning-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg);
    border: 2px solid var(--text-main);
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.learning-card::before {
    display: none;
}


/* --- 6. Learning Now Card --- */
.learning-card {
    /* Removed specific background to inherit glassmorphism */
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.learning-card > * {
    position: relative;
    z-index: 1;
}

.learning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
    text-transform: uppercase;
}

.learning-header i {
    color: #FF9F43; /* Orange accent for learning */
    font-size: 1.1rem;
}

.learning-tech {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    z-index: 2;
}

.tech-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.progress-ring {
    position: relative;
    width: 80px; /* Restored to 80px to match SVG */
    height: 80px;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.progress-ring-circle-bg {
    fill: none;
    stroke: var(--bg-color); /* Matches card bg or slightly darker */
    stroke-width: 6;
}

body.dark-mode .progress-ring-circle-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring-circle {
    fill: none;
    stroke: #43CBFF; /* Bright Blue Progress */
    stroke-width: 6;
    stroke-dasharray: 200; /* Approx circumference for r=32 (2*pi*32 ~= 201) */
    stroke-dashoffset: 160; /* 20% progress = 200 - (200 * 0.2) = 160 */
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.learning-card .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- Blog Card (2x1) --- */
.blog-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-header i {
    font-size: 1.3rem;
    color: var(--primary-start);
}

.blog-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.blog-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.blog-date i {
    font-size: 0.9rem;
}

.blog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-start);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.blog-link:hover {
    gap: 10px;
    color: var(--primary-end);
}

.blog-link i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.blog-link:hover i {
    transform: translateX(4px);
}

/* --- Projects Card (2x2) --- */
.projects-card {
    grid-column: span 2;
    grid-row: span 2;
}

/* --- Portfolio Card (2x2) --- */
.portfolio-card {
    grid-column: span 2;
    grid-row: span 2;
}

/* Disable hover float for scrollable containers */
.projects-card:hover,
.portfolio-card:hover {
    transform: none;
    box-shadow: var(--card-shadow); /* Reset to default shadow, no hover boost */
}

/* Allow scrollbar to be visible (override parent overflow:hidden) */
.projects-card,
.portfolio-card {
    overflow-x: visible; /* Critical: Allow horizontal overflow for scrollbar */
    overflow-y: hidden;  /* Keep vertical overflow hidden */
}


/* Performance: Content Visibility for below-fold cards */
.projects-card,

.portfolio-card,
.blog-card,
.site-footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
}

.card-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: auto;
}

.portfolio-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    min-height: 200px;
}

.project-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-item:hover {
    transform: scale(1.05);
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.project-item:hover img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

/* Always show overlay for Swiper project slides */
.project-slide-item .project-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 16px 12px 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    border-radius: var(--border-radius-sm);
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-placeholder i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.project-placeholder:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.project-placeholder:hover i {
    opacity: 1;
}

/* Lazy Image Loading */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* --- Footer --- */
.footer-wrapper {
    max-width: var(--max-width);
    margin: 40px auto 20px;
    padding-bottom: 180px;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.6s ease-out;
}

.site-footer.footer-visible {
    transform: translateY(0);
}

.footer-grid-container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 20px 20px;
    padding: 25px 30px;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    border: 2px solid var(--text-main);
    box-shadow: none;
    color: var(--text-main);
    font-size: 0.9em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 100px;
}

.footer-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.footer-item-title {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--text-main);
    margin-right: 8px;
    flex-shrink: 0;
}

.footer-grid-container .footer-item:nth-child(odd) {
    justify-content: flex-end;
}

.footer-grid-container .footer-item:nth-child(even) {
    justify-content: flex-start;
}

.footer-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-item a:hover {
    color: var(--primary-start);
}

.footer-item.full-width {
    grid-column: 1 / -1;
    justify-content: center !important;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--text-main);
    font-size: 0.85em;
    opacity: 0.8;
}

/* Privacy Switch */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* --- Privacy Banner --- */
#privacy-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    z-index: 9999;
    display: none;
    text-align: center;
    color: var(--text-main);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

#privacy-banner p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.privacy-btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.privacy-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.privacy-btn.accept {
    background: var(--primary-gradient);
    color: #FFFFFF;
}

.privacy-btn.accept:hover {
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    transform: translateY(-2px);
}

.privacy-btn.reject {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
}

.privacy-btn.reject:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .privacy-btn.reject:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.2rem;
    z-index: 999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-gradient);
    color: #FFFFFF;
    transform: translateY(-5px);
}

/* --- Responsive Design --- */

/* Tablet (768px - 992px) */
@media (max-width: 992px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 90px;
    }

    .hero-card,
    .skills-card,
    .projects-card,
    .portfolio-card {
        grid-column: span 2;
    }

    .about-card {
        grid-column: span 2;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* --- Mobile Performance Overrides --- */
    /* 1. Disable expensive backdrop filters */
    .floating-nav,
    .condition-badge,
    .footer-grid-container,
    .back-to-top {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.95);
    }
    body.dark-mode .floating-nav,
    body.dark-mode .footer-grid-container,
    body.dark-mode .back-to-top {
        background: rgba(26, 26, 26, 0.95);
    }

    /* 2. Disable heavy background animations */
    .ambient-background {
        display: none;
    }
    body::before {
        animation: none;
        opacity: 0.02;
    }
    .blob {
        animation: none !important;
        opacity: 0.4;
    }

    /* 3. Disable repaint-heavy gradient animations */
    .stat-card,
    .learning-card,
    .quote-card {
        animation: none !important;
        background-position: 0% 50%;
    }

    .floating-nav {
        top: 10px;
        padding: 10px 16px;
        gap: 12px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .bento-container {
        grid-template-columns: 1fr;
        margin-top: 80px;
        gap: 16px;
    }

    /* All cards span 1 column on mobile */
    .hero-card,
    .profile-card,
    .about-card,
    .skills-card,
    .projects-card,
    .portfolio-card {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Adjust hero card for mobile */
    .hero-card {
        min-height: 300px;
        padding: 24px;
    }

    #hero-title {
        font-size: 1.6rem;
    }

    /* Stack hero stats chips on mobile */
    .hero-stats {
        gap: 6px;
    }

    .chip {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    /* Stack hero action buttons on mobile */
    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn-pill {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    /* Hide decorative lines on mobile for cleaner look */
    .hero-card::before,
    .hero-card::after {
        display: none;
    }

    /* Adjust skills grid */
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 10px;
    }

    .skill-tag {
        padding: 10px 6px;
        gap: 6px;
    }

    .skill-tag i {
        font-size: 1.8rem;
    }

    .skill-tag span {
        font-size: 0.75rem;
    }

    /* Adjust projects grid */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);

    }

    /* Footer adjustments */
    .footer-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
        text-align: center;
    }

    .footer-grid-container .footer-item,
    .footer-grid-container .footer-item:nth-child(odd),
    .footer-grid-container .footer-item:nth-child(even) {
        justify-content: center;
        font-size: 0.85rem;
    }

    .footer-wrapper {
        padding-bottom: 280px;
    }

    /* Back to top button */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 8px;
    }

    .skill-tag {
        padding: 8px 4px;
    }
}

/* ========================================
   Enhanced Visual Effects
   ======================================== */

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- 1. Staggered Card Entrance Animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bento-card {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.bento-card:nth-child(1) { animation-delay: 0.1s; }
.bento-card:nth-child(2) { animation-delay: 0.15s; }
.bento-card:nth-child(3) { animation-delay: 0.2s; }
.bento-card:nth-child(4) { animation-delay: 0.25s; }
.bento-card:nth-child(5) { animation-delay: 0.3s; }
.bento-card:nth-child(6) { animation-delay: 0.35s; }
.bento-card:nth-child(7) { animation-delay: 0.4s; }
.bento-card:nth-child(8) { animation-delay: 0.45s; }






/* --- 4. Jelly Interaction Effect --- */
@keyframes jelly {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.15, 0.85); }
    40% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.05, 0.95); }
    65% { transform: scale(0.98, 1.02); }
    75% { transform: scale(1.02, 0.98); }
    100% { transform: scale(1, 1); }
}

.btn-pill:hover {
    animation: jelly 0.6s ease-in-out both;
}

.skill-tag:hover i {
    animation: jelly 0.6s ease-in-out both;
}

.skill-tag:hover {
    transform: translateY(-4px);
}

/* --- Music Card (1x1) --- */
.music-card {
    position: relative;
    overflow: hidden;
    color: var(--text-main);
}

/* Background Blur Effect */
.music-bg-blur {
    display: none;
}

.music-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header & Waveform */
.music-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.music-status {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    padding: 4px 10px;
    border-radius: 0;
    backdrop-filter: none;
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

.music-wave {
    display: flex;
    align-items: flex-end;
    height: 12px;
    gap: 2px;
}

.music-wave span {
    width: 3px;
    background: var(--text-main);
    border-radius: 0;
    animation: wave 1s ease-in-out infinite;
}

.music-wave span:nth-child(1) { animation-duration: 0.6s; height: 40%; }
.music-wave span:nth-child(2) { animation-duration: 0.8s; height: 100%; }
.music-wave span:nth-child(3) { animation-duration: 0.5s; height: 60%; }
.music-wave span:nth-child(4) { animation-duration: 0.7s; height: 80%; }

@keyframes wave {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .music-wave span {
        animation: none;
        height: 60%;
    }
}

/* Album Art */
.music-center {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.music-cover-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border: 2px solid var(--text-main);
    transition: transform 0.3s ease;
}

.music-cover-wrapper:hover {
    transform: scale(1.05);
}

.music-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Song Info */
.music-footer h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
}

.music-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Performance Optimization */
@media (max-width: 768px) {
    .music-bg-blur {
        filter: blur(15px) brightness(0.4);
    }
}

/* --- Currently Reading Card (1x1) --- */
.reading-card {

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    position: relative;
}

.reading-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.reading-header i {
    color: var(--text-main);
    font-size: 1rem;
}

/* Move progress percentage to header */
.reading-header .progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    background: transparent;
    padding: 2px 8px;
    border-radius: 0;
    border: 1px solid var(--text-main);
}

.reading-content {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-start; /* Fix: Align content to start, not center */
}

.book-cover {
    width: 55px;
    height: 75px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.book-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reading-progress {
    margin-top: 6px;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

body.dark-mode .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* --- Modern Horizontal Scroll Container (Replaces Swiper) --- */
.scroll-container {
    display: flex;
    overflow-x: scroll; /* Force scrolling track specifically */
    gap: 24px;
    padding: 10px 4px 20px 4px; /* Standard visible padding */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    
    /* Force Scrollbar Visuals - Enhanced for macOS */
    scrollbar-color: rgba(0, 0, 0, 0.6) rgba(0, 0, 0, 0.1); /* Firefox: Darker thumb, visible track */
    scrollbar-width: auto; /* Ensure scrollbar is always shown */
    cursor: grab;
}

/* Custom Scrollbar - Enhanced visibility */
.scroll-container::-webkit-scrollbar {
    -webkit-appearance: none;
    height: 14px; /* Increased height for better visibility */
    background-color: rgba(0, 0, 0, 0.08); /* More visible background */
}

.scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1); /* More opaque track */
    border-radius: 7px;
    margin: 0 4px; /* Slight inset */
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.6); /* Darker, more visible thumb */
    border-radius: 7px;
    border: 2px solid rgba(255, 255, 255, 0.1); /* Subtle border for definition */
    background-clip: padding-box;
    min-width: 40px; /* Ensure thumb is always visible */
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.8); /* Even darker on hover */
}

/* Force scrollbar buttons to trigger permanent visibility on Mac */
.scroll-container::-webkit-scrollbar-button {
    display: block;
    height: 1px; /* Tiny visible height to force traditional scrollbar */
    width: 1px;
    background: transparent;
}

/* Dark mode adjustments - Enhanced visibility */
body.dark-mode .scroll-container {
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1); /* More visible in dark mode */
}

body.dark-mode .scroll-container::-webkit-scrollbar {
    background-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1); /* More opaque track */
}

body.dark-mode .scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4); /* Much more visible default */
    border: 2px solid rgba(0, 0, 0, 0.2);
}

body.dark-mode .scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6); /* Brighter on hover */
}

.scroll-container:active {
    cursor: grabbing;
}

/* Scroll Snap Item / Card */
.scroll-card {
    flex: 0 0 auto;
    width: 280px; /* Fixed width for consistent look */
    height: 220px; /* Reduced height as requested (was 380px) */
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    scroll-snap-align: center;
    text-decoration: none;
    background: var(--card-bg);
    /* box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
}

/* Hover Effects - Parallax feel via scale */
/* Hover Effects - Removed per user request */
.scroll-card:hover {
    /* transform: translateY(-8px) scale(1.02); */
    /* box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); */
    z-index: 10;
}


body.dark-mode .scroll-card {
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .scroll-card:hover {
    /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); */
    /* border-color: rgba(255, 255, 255, 0.15); */
}

/* Card Media Wrapper */
.card-media {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease-out; /* Smooth internal scale */
}

.scroll-card:hover .card-media img {
    /* transform: scale(1.1); Zoom effect on hover */
}

/* Overlay Styling */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    opacity: 1; /* Always visible for better UX, or can be 0 and 1 on hover */
    transition: opacity 0.3s ease;
}

.card-overlay span {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.scroll-card:hover .card-overlay span {
    transform: translateY(-5px);
}

/* Placeholder Styling */
.scroll-card.placeholder {
    background: rgba(0, 0, 0, 0.03);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

body.dark-mode .scroll-card.placeholder {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.scroll-card.placeholder:hover {
    transform: none;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    text-align: center;
    height: 100%;
}

.placeholder-content i {
    font-size: 2rem;
    opacity: 0.5;
}

.placeholder-content span {
    font-size: 0.9rem;
    font-weight: 600;
}
