:root {
            --bg-color: #000000;
            --text-color: #ffffff;
            --secondary-text: #8e8e93;
            --accent-color: #0071e3;
            --border-color: rgba(255, 255, 255, 0.1);
            --card-bg: rgba(28, 28, 30, 0.7);
            --glass: rgba(255, 255, 255, 0.05);
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            overflow-x: hidden;
        }

        /* Hero Section */
        header.hero {
            position: relative;
            height: 90vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 0 10%;
            z-index: 1;
        }

        header.hero::before {
            content: '';
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background-image: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.9)), url('/static/img/wallpaper.jpg');
            background-size: cover;
            background-position: center;
            z-index: -1;
            -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
            mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
        }

        header.hero h1 {
            font-size: clamp(48px, 10vw, 96px);
            font-weight: 700;
            line-height: 1.05;
            margin-bottom: 24px;
            letter-spacing: -3px;
            background: linear-gradient(to right, #fff, #a1a1a6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        header.hero p {
            font-size: clamp(18px, 2.5vw, 28px);
            color: #d1d1d6;
            max-width: 700px;
            font-weight: 400;
            line-height: 1.4;
        }

        .wallpaper-credit {
            position: absolute;
            bottom: 30px;
            right: 40px;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: rgba(255, 255, 255, 0.3);
            text-decoration: none;
            transition: all 0.3s ease;
            z-index: 10;
        }

        .wallpaper-credit:hover {
            color: #fff;
            text-shadow: 0 0 10px rgba(255,255,255,0.5);
        }

        /* Split Section: Blog & Labs */
        .entries-container {
            display: flex;
            border-bottom: 1px solid var(--border-color);
            min-height: 600px;
        }

        .entry-block {
            flex: 1;
            position: relative;
            text-decoration: none;
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            padding: 80px 10%;
            overflow: hidden;
            border-right: 1px solid var(--border-color);
            background-size: cover;
            background-position: center;
        }

        .entry-block:last-child { border-right: none; }

        .entry-block .overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
            z-index: 1;
        }

        .entry-block .bg-image {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background-size: cover;
            background-position: center;
            opacity: 0.3;
            transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
            transform: scale(1.05);
            z-index: 0;
        }

        .entry-block:hover .bg-image {
            opacity: 0.5;
            transform: scale(1);
        }

        .entry-block .content {
            position: relative;
            z-index: 2;
            width: 100%;
        }

        .entry-block .label {
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--accent-color);
            margin-bottom: 16px;
            display: block;
        }

        .entry-block h3 {
            font-size: 56px;
            font-weight: 700;
            letter-spacing: -2px;
            margin-bottom: 50px;
        }

        /* Recent Posts/Labs List */
        .recent-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 40px;
        }

        .list-link {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            text-decoration: none;
            color: #d1d1d6;
            font-size: 16px;
            transition: all 0.2s;
        }

        .list-link:hover {
            color: white;
            border-bottom-color: var(--accent-color);
            padding-left: 5px;
        }

        .list-link .item-title {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-right: 20px;
        }

        .list-link .item-meta {
            font-family: monospace;
            font-size: 14px;
            color: var(--secondary-text);
            flex-shrink: 0;
        }

        /* Section General Styling */
        section {
            padding: 120px 10%;
            border-bottom: 1px solid var(--border-color);
        }

        section h2 {
            font-size: 42px;
            font-weight: 700;
            margin-bottom: 60px;
            letter-spacing: -1.5px;
        }

        /* Labs Grid */
        .labs-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 24px;
        }

        .lab-item {
            background: var(--glass);
            padding: 40px;
            border-radius: 12px;
            text-decoration: none;
            color: white;
            border: 1px solid var(--border-color);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .lab-item:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-8px);
            border-color: rgba(255, 255, 255, 0.3);
        }

        .lab-item i {
            font-size: 24px;
            color: var(--accent-color);
        }

        /* Career Section with Company Logos */
        .career-container {
            max-width: 2400px;
        }

        .career-item {
            display: grid;
            grid-template-columns: 160px 64px 1fr 720px;
            gap: 0px;
            padding: 80px 0;
            border-bottom: 1px solid var(--border-color);
            align-items: start;
        }

        .career-item:last-child { border-bottom: none; }

        .career-date-column {
            display: flex;
            flex-direction: column;
            gap: 0; /* Will align with rows via height matching */
        }

        .date-cell {
            color: var(--secondary-text);
            font-size: 16px;
            font-weight: 500;
            height: 40px; 
            display: flex;
            align-items: center;
            margin-bottom: 30px; 
            line-height: 1; /* Reset line-height to ensure flex centering is consistent */
        }

        .date-cell.sub {
            height: 28px; 
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            line-height: 1; /* Match position-name */
        }

        .career-item .company-logo {
            width: 64px;
            height: 64px;
            margin-left: -90px; 
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            margin-top: -12px;
        }

        .career-item .company-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .career-item .details {
            min-width: 0;
            margin-left: -20px; 
        }

        .career-item .details h4 {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 30px; 
            line-height: 1;
            height: 40px; 
            display: flex;
            align-items: center;
        }

        .career-item .details .position-name {
            font-size: 18px;
            color: var(--accent-color);
            font-weight: 500;
            margin-bottom: 16px; 
            line-height: 1; /* Changed from 1.4 to 1 to match date-cell.sub */
            height: 28px; 
            display: flex;
            align-items: center;
        }

        .career-item .details p {
            color: #d1d1d6;
            font-size: 17px;
            max-width: 100%;
            margin-bottom: 12px;
        }

        /* Timeline Effect: Line only within items with multiple roles */
        .career-item .career-date-column {
            position: relative;
        }

        .career-item .career-date-column::after {
            content: '';
            position: absolute;
            right: -9px; 
            top: 70px; /* 40px (empty cell) + 16px (margin) + 14px (center of first dot) */
            bottom: 30px; /* 16px (margin) + 14px (center of last dot) */
            width: 2px;
            background: var(--border-color);
            z-index: 1;
            display: none;
        }

        /* Show and override only for multi-item containers */
        .career-item .career-date-column:has(.date-cell.sub + .date-cell.sub)::after {
            display: block;
        }

        .date-cell.sub {
            position: relative;
            z-index: 2; /* Ensure dot is above the line */
        }

        .date-cell.sub::after {
            content: '';
            position: absolute;
            right: -14px; /* Matches center of line at -9px */
            top: 50%;
            transform: translateY(-50%);
            width: 12px;
            height: 12px;
            background: var(--bg-color);
            border: 2px solid var(--secondary-text);
            border-radius: 50%;
            z-index: 3;
            transition: all 0.3s ease;
        }

        .career-item:hover .date-cell.sub::after {
            border-color: var(--accent-color);
            background: var(--accent-color);
            box-shadow: 0 0 10px var(--accent-color);
        }

        .projects-area {
            width: 720px;
            padding-left: 20px;
            border-left: 1px solid var(--border-color);
            display: grid;
            grid-template-columns: 350px 350px;
            gap: 16px;
            align-content: start;
        }

        .projects-area h5 {
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--accent-color);
            margin-bottom: 0;
            grid-column: span 2;
        }

        .project-item {
            background: rgba(255, 255, 255, 0.03);
            padding: 12px 16px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            display: grid;
            grid-template-columns: 48px 1fr;
            gap: 12px;
            align-items: start;
            min-height: 100px;
        
            position: relative;
            overflow: hidden;
            transition: transform 0.3s ease, box-shadow 0.3s ease;}

        .project-logo {
            width: 48px;
            height: 48px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--border-color);
            overflow: hidden;
            margin-top: 2px;
        }

        .project-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .project-content {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .project-item h6 {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 4px;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .process-node {
            font-size: 9px;
            background: var(--accent-color);
            color: #fff;
            padding: 1px 6px;
            border-radius: 4px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .project-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            min-width: 0;
        }

        .project-tag {
            font-size: 10px;
            background: rgba(0, 113, 227, 0.1);
            color: var(--accent-color);
            padding: 2px 8px;
            border-radius: 4px;
            font-weight: 600;
            border: 1px solid rgba(0, 113, 227, 0.2);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .footer-left h2 {
            font-size: 48px;
            letter-spacing: -2px;
            margin-bottom: 24px;
        }

        .contact-pills {
            display: flex;
            gap: 16px;
        }

        .pill {
            padding: 12px 28px;
            border-radius: 40px;
            background: #fff;
            color: #000;
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s;
        }

        .pill:hover { opacity: 0.8; transform: scale(1.02); }

                @media (min-width: 901px) and (max-width: 1500px) {
            /* 页面宽度在 901px~1500px 之间：左侧栏不动，project 卡片变单列 */
            .career-item {
                grid-template-columns: 160px 64px 1fr 360px;
            }
            .projects-area {
                width: 360px;
                grid-template-columns: 1fr;
            }
            .projects-area h5 {
                grid-column: span 1;
            }
        }

        @media (max-width: 900px) {
            header.hero { height: 60vh; padding: 0 6%; }
            header.hero h1 { font-size: 36px; letter-spacing: -1px; }
            header.hero p { font-size: 16px; }

            section { padding: 60px 6%; }
            section h2 { font-size: 28px; margin-bottom: 30px; }

            .entries-container { flex-direction: column; }
            .entry-block { padding: 40px 6%; border-right: none; border-bottom: 1px solid var(--border-color); min-height: auto; }
            .entry-block h3 { font-size: 32px; margin-bottom: 20px; }
            
            /* Mobile Timeline Optimization */
            .career-item { 
                grid-template-columns: 1fr; 
                gap: 16px; 
                padding: 40px 0; 
                position: relative;
            }

            .career-date-column { 
                display: flex;
                flex-direction: column;
                gap: 8px;
                margin-bottom: 0;
            }

            .career-date-column .date-cell:first-child { display: none; } /* Hide empty cell */
            
            .date-cell, .date-cell.sub { 
                height: auto; 
                margin: 0; 
                font-size: 14px;
                color: var(--accent-color); /* Highlight dates on mobile */
                font-weight: 600;
            }

            /* Simplified Timeline Line for Mobile */
            .career-item .details {
                margin-left: 0;
                padding-left: 20px;
                border-left: 2px solid var(--border-color);
                position: relative;
            }

            .career-item .details h4 {
                height: auto;
                font-size: 22px;
                margin-bottom: 12px;
            }

            .career-item .details .position-name {
                height: auto;
                font-size: 16px;
                margin-bottom: 8px;
                padding-left: 0;
            }

            /* Add dots to positions on mobile */
            .career-item .details .position-name::before {
                content: '';
                position: absolute;
                left: -7px;
                width: 12px;
                height: 12px;
                background: var(--bg-color);
                border: 2px solid var(--accent-color);
                border-radius: 50%;
            }

            .career-item .company-logo {
                margin: 0 0 16px 0;
                width: 48px;
                height: 48px;
            }

            .projects-area { 
                width: 100% !important; 
                padding-left: 20px !important; 
                border-left: 2px solid var(--border-color) !important; 
                border-top: none !important; 
                margin-top: 0 !important;
                display: block !important; /* Switch to block to stack items */
            }

            .projects-area h5 {
                display: block !important;
                margin-bottom: 12px !important;
            }

            .project-item { 
                display: grid !important;
                grid-template-columns: 48px 1fr !important;
                min-height: auto !important; 
                padding: 16px !important; 
                width: 100% !important;
                margin-bottom: 16px !important; /* Add spacing between stacked cards */
            }

            .project-content h6 {
                white-space: normal; /* Allow title to wrap if too long */
                word-break: break-word;
            }

            .project-tags {
                display: flex;
                flex-wrap: wrap;
                gap: 8px;
                min-width: 0;
            }

            .career-date-column::after, .date-cell.sub::after { display: none; }

            .footer-content { flex-direction: column; align-items: flex-start; gap: 30px; padding-top: 40px; }
            .footer-left h2 { font-size: 32px; }
        }

        /* Skills Grid */
        .skills-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 32px;
        }

        .skill-card {
            background: var(--glass);
            padding: 40px;
            border-radius: 16px;
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
        
            position: relative;
            overflow: hidden;}

        .skill-card:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.2);
            transform: translateY(-5px);
        }

        .skill-card > i {
            font-size: 28px;
            color: var(--accent-color);
            margin-bottom: 24px;
            display: block;
        }

        .skill-card h3 {
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 20px;
        }

        .skill-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .skill-tags span {
            font-size: 13px;
            padding: 6px 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            color: #d1d1d6;
            border: 1px solid var(--border-color);
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            line-height: normal;
        }

        .skill-tags span i, 
        .skill-tags span img {
            width: 15px;
            height: 15px;
            max-width: 15px;
            max-height: 15px;
            flex-shrink: 0;
            margin: 0;
            padding: 0;
            display: block;
            transform: translateY(0.5px);
            object-fit: contain;
        }

        .skill-tags span i {
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .skill-tags span.lang {
            color: #76c893;
            border-color: rgba(118, 200, 147, 0.15);
            background: rgba(118, 200, 147, 0.03);
        }

        .skill-tags span.tool {
            color: #b39ddb;
            border-color: rgba(179, 157, 219, 0.15);
            background: rgba(179, 157, 219, 0.03);
        }

        .skill-tags a {
            text-decoration: none;
            color: inherit;
            display: inline-block;
        }

        .skill-tags span:hover {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.4);
            transform: translateY(-2px);
        }

        .skill-tags span.lang:hover {
            background: rgba(118, 200, 147, 0.1);
            border-color: rgba(118, 200, 147, 0.4);
        }

        .skill-tags span.tool:hover {
            background: rgba(179, 157, 219, 0.1);
            border-color: rgba(179, 157, 219, 0.4);
        }

        /* Footer Redesign */
        .footer-left h2 {
            font-size: 48px;
            letter-spacing: -2px;
            margin-bottom: 40px;
        }

        .contact-sections {
            display: flex;
            flex-direction: column;
            gap: 48px;
        }

        .contact-group h5 {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--secondary-text);
            margin-bottom: 20px;
        }

        /* Primary Contacts */
        .contact-pills {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .pill {
            padding: 12px 28px;
            border-radius: 40px;
            background: #fff;
            color: #000;
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .pill:hover { opacity: 0.8; transform: scale(1.02); }

        .pill.outline {
            background: transparent;
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .pill.outline:hover {
            border-color: #fff;
            background: rgba(255, 255, 255, 0.05);
        }

        /* Network Links (Low Priority) */
        .network-links {
            display: flex;
            flex-wrap: wrap;
            gap: 24px;
        }

        .network-link {
            font-size: 14px;
            color: var(--secondary-text);
            text-decoration: none;
            transition: all 0.2s ease;
            border-bottom: 1px solid transparent;
        }

        .network-link:hover {
            color: #fff;
            border-bottom-color: var(--accent-color);
        }

        /* WeChat Modal */
        #wechat-modal {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.9);
            z-index: 2000;
            backdrop-filter: blur(10px);
            justify-content: center;
            align-items: center;
            cursor: pointer;
        }

        .modal-content {
            background: #1c1c1e;
            padding: 30px;
            border-radius: 24px;
            text-align: center;
            border: 1px solid var(--border-color);
            transform: scale(0.9);
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        #wechat-modal.active { display: flex; }
        #wechat-modal.active .modal-content { transform: scale(1); }

        .modal-content img {
            width: 200px;
            height: 200px;
            border-radius: 12px;
            margin-bottom: 20px;
        }

        .modal-content p {
            color: #fff;
            font-size: 14px;
            font-weight: 500;
        }

        /* Busuanzi Statistics */
        .site-stats {
            margin-top: 32px;
            display: flex;
            gap: 24px;
            font-size: 12px;
            color: var(--secondary-text);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stat-item i {
            color: var(--accent-color);
            font-size: 14px;
        }

        .stat-item .unit {
            margin-left: 2px;
            opacity: 0.8;
        }

        #uptime-stats {
            margin-top: 12px;
            font-family: monospace;
            display: flex;
            gap: 12px;
        }

        /* Project Description */
        .project-desc {
            font-size: 11px;
            color: var(--secondary-text);
            margin-top: 6px;
            line-height: 1.4;
        }    
/* ===== Rainbow border on project card hover ===== */

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rainbow-spin {
  to { --angle: 360deg; }
}

.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-link:hover .project-item {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* ::before 负责彩色边框，mask 裁出 1.5px 细线，opacity 控制显隐 */
.project-link .project-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 0.75px;
    background: conic-gradient(
        from var(--angle),
        #ff6ec7, #a78bfa, #60a5fa, #34d399, #fbbf24, #f87171, #ff6ec7
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.project-link:hover .project-item::before {
    opacity: 1;
    animation: rainbow-spin 3s linear infinite;
}

/* skill-card 同款彩色边框 */
.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 0.75px;
    background: conic-gradient(
        from var(--angle),
        #ff6ec7, #a78bfa, #60a5fa, #34d399, #fbbf24, #f87171, #ff6ec7
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.skill-card:hover::before {
    opacity: 1;
    animation: rainbow-spin 3s linear infinite;
}


/* GitHub stats badge (Education projects) */
.github-stats {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
    align-self: flex-end;
}
.github-stats img {
    height: 18px;
    display: block;
}
