@charset "UTF-8";

:root {
    --primary-color: #007DFF;
    /* Harmony Blue */
    --accent-color: #55B5DB;
    /* Nature Cyan */
    --text-main: #191919;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --bg-color: #F1F3F5;
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --blur-amt: 30px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.06);
    --radius-l: 32px;
    --radius-m: 20px;
    --radius-s: 12px;
    --transition-smooth: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@font-face {
    font-family: 'HarmonyOS Sans';
    src: local('HarmonyOS Sans SC'), local('PingFang SC');
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'HarmonyOS Sans', 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #F2F3F5;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(200, 230, 255, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(230, 250, 230, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(240, 230, 255, 0.3) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 60px 40px;
    /* Reduced padding for wider visual */
    line-height: 1.7;
    color: var(--text-main);
}

.resume {
    max-width: 1400px;
    /* Increased max width for 2-column layout */
    margin: 0 auto;
    /* Removed container card style for the wrapper, moving to grid items */
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
}

/* ==================
   New 2-Column Layout
   ================== */

.main-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    /* Fixed Sidebar, flexible content */
    gap: 30px;
    align-items: stretch;
    /* Stretch to make columns equal height */
}

/* Sidebar Styles */
.sidebar {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(var(--blur-amt));
    -webkit-backdrop-filter: blur(var(--blur-amt));
    border: var(--glass-border);
    border-radius: var(--radius-m);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Distribute content to fill height */
    gap: 40px;
    /* Removed sticky to ensure symmetry in static view */
    height: 100%;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 100;
}

.profile-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    /* border: 4px solid rgba(255, 255, 255, 0.9); */
    /* box-shadow: 0 10px 20px rgba(0,0,0,0.05); */
    overflow: hidden;
    /* Reverting custom gradients as we are using an img now */
    background: transparent;
}

.profile-info h1 {
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 600;
}

.profile-info .title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center align for sidebar */
    gap: 12px;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    width: 100%;
    /* Full width in sidebar */
    justify-content: center;
    /* Center content */
    transition: var(--transition-smooth);
    position: relative;
    /* For popup positioning */
    cursor: pointer;
}

.contact-item:hover {
    background: #fff;
    transform: translateY(-2px);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qr-popup {
    position: absolute;
    left: calc(100% + 15px);
    /* Position to the right */
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    /* Center vertically */
    bottom: auto;
    /* Reset bottom */

    width: 250px;
    /* Larger size */
    height: 250px;

    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 1000;
    visibility: hidden;
}

.contact-item:hover .qr-popup {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    visibility: visible;
}

.qr-popup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    border-radius: 8px;
    background: #f5f5f5;
    /* Slight background for transparent images */
}

/* Arrow for the popup pointing left */
.qr-popup::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    /* Arrow on the left side of the popup */
    left: auto;
    transform: translateY(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}

.contact-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.sidebar-section {
    width: 100%;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
}

.sidebar-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

.sidebar-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-size: 13px;
    padding: 6px 12px;
    background: white;
    border-radius: 8px;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar-item {
    background: rgba(255, 255, 255, 0.4);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.sidebar-item-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.sidebar-item-sub {
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.sidebar-item-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Main Content Styles */
.main-content {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(var(--blur-amt));
    -webkit-backdrop-filter: blur(var(--blur-amt));
    border: var(--glass-border);
    border-radius: var(--radius-m);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ensure it fills the grid cell */
    min-width: 0;
    /* Fix grid overflow */
}

/* Section overrides for main content */
/* Section Header */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 24px;
    color: var(--text-main);
    font-weight: 600;
}

.section-subtitle {
    display: inline-block;
    font-size: 14px;
    color: var(--text-tertiary);
}

.section-subtitle::before {
    content: "·";
    margin-right: 12px;
}

.section-header .personal-site-btn {
    margin-left: auto;
}



.about-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-m);
    backdrop-filter: blur(var(--blur-amt));
    border: var(--glass-border);
}

/* Projects Grid 2 Columns */
.projects-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(var(--blur-amt));
    -webkit-backdrop-filter: blur(var(--blur-amt));
    border-radius: var(--radius-m);
    padding: 24px;
    transition: var(--transition-smooth);
    border: var(--glass-border);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.project-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-hover);
    z-index: 2;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
    /* Push footer down */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    /* Push to bottom if desc is short */
}

.tag {
    background: rgba(0, 125, 255, 0.08);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.view-detail {
    display: inline-block;
    margin-top: 15px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-smooth);
}

.project-card:hover .view-detail {
    opacity: 1;
    transform: translateX(0);
}

/* Feature List (for Modal) */
.feature-list {
    list-style: none;
}

.feature-list li {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.feature-list li:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    flex-shrink: 0;
}

.feature-list li strong {
    color: var(--text-main);
    margin-right: 4px;
}

/* ==================
   Modal Styles
   ================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.close-btn {
    color: #aaa;
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    z-index: 10;
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    background: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    cursor: pointer;
}

/* Modal Internal Layout */
.modal-header {
    background: var(--primary-color);
    padding: 40px;
    position: relative;
    color: #fff;
}

.modal-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #ffffff;
}

.modal-header .subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.modal-header .tag {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-body-content {
    padding: 40px;
    background: #fff;
    max-height: 70vh;
    overflow-y: auto;
}

.sub-section {
    margin-bottom: 30px;
}

.sub-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

.sub-section p {
    color: #666;
    line-height: 1.6;
}

/* Tech Grid in Modal */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.tech-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.tech-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
}

.tech-desc {
    color: #666;
    font-size: 13px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 页脚 */
.footer {
    grid-column: 1 / -1;
    /* Span full width */
    background: transparent;
    color: var(--text-tertiary);
    text-align: center;
    padding: 40px;
    font-size: 13px;
    margin-top: 20px;
}

/* Personal Site Button */
.personal-site-btn {
    font-size: 14px;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    margin-left: auto;
    /* Push to right */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 125, 255, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.personal-site-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 125, 255, 0.4);
    background: #0060d0;
    color: #fff;
}

/* Mobile Bottom Nav - Hidden by default */
.mobile-bottom-nav {
    display: none;
}

/* Responsive */

/* Mobile Bottom Nav Definition (Hidden on Desktop) */
.mobile-bottom-nav {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #888;
    gap: 2px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.nav-item.active {
    color: var(--primary-color);
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
        display: block !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 9999 !important;
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(65px + env(safe-area-inset-bottom)) !important;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    }

    .sidebar,
    .main-content {
        height: auto !important;
        min-height: auto !important;
    }

    /* Make the content area independent and scrollable above the nav */
    .resume {
        height: calc(100vh - (65px + env(safe-area-inset-bottom))) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 10px !important;
        padding-bottom: 20px !important;
    }

    .mobile-hidden {
        display: none !important;
    }

    /* Disable hover popup on mobile */
    .qr-popup {
        display: none !important;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .profile-header {
        flex-direction: row;
        text-align: left;
        margin-bottom: 15px;
        gap: 12px;
    }

    .avatar {
        width: 65px;
        height: 65px;
    }

    .profile-info h1 {
        font-size: 20px !important;
        margin-bottom: 2px !important;
    }

    .profile-info .title {
        font-size: 13px !important;
    }

    .sidebar,
    .main-content {
        padding: 18px !important;
        margin-bottom: 12px !important;
    }

    .contact-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .contact-item:nth-child(3) {
        grid-column: span 2 !important;
    }

    .contact-item {
        padding: 5px 8px !important;
        font-size: 12px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        background: rgba(255, 255, 255, 0.5) !important;
        border-radius: 8px !important;
    }

    .contact-item span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .contact-item svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    .sidebar-section {
        margin-bottom: 6px !important;
    }

    .sidebar-title {
        font-size: 15px !important;
        margin-bottom: 4px !important;
        padding-bottom: 2px !important;
        margin-top: 5px !important;
    }

    .sidebar-text {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    .sidebar-skills {
        gap: 5px !important;
    }

    .sidebar-item {
        padding: 8px 10px !important;
        margin-bottom: 5px !important;
    }

    .sidebar-item-title {
        font-size: 14px !important;
        margin-bottom: 0px !important;
    }

    .sidebar-item-sub,
    .sidebar-item-date {
        font-size: 11px !important;
    }

    .skill-tag {
        padding: 4px 10px !important;
        font-size: 12px !important;
    }

    .modal-content {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-radius: 28px 28px 0 0 !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        animation: slideUpBottom 0.5s cubic-bezier(0.32, 0.72, 0, 1) !important;
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.2) !important;
        border: none !important;
    }

    /* Pull-to-close indicator handle */
    .modal-content::before {
        content: "";
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 42px;
        height: 5px;
        background: rgba(255, 255, 255, 0.35);
        border-radius: 10px;
        z-index: 1001;
    }

    .modal-header {
        padding: 36px 20px 24px !important;
        background: linear-gradient(135deg, var(--primary-color), #0060d0) !important;
        border-radius: 0 !important;
    }

    .modal-header h2 {
        font-size: 21px !important;
        letter-spacing: -0.3px !important;
    }

    .modal-body-content {
        padding: 24px 18px 60px !important;
        background: #fff !important;
    }

    .modal-body-content p {
        font-size: 13.5px !important;
        line-height: 1.6 !important;
    }

    .close-btn {
        top: 15px !important;
        right: 15px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(4px) !important;
        color: white !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }

    .sub-section h3 {
        font-size: 16px !important;
        background: rgba(0, 125, 255, 0.04) !important;
        padding: 8px 12px !important;
        border-radius: 10px !important;
        margin-top: 24px !important;
        margin-bottom: 12px !important;
    }

    .feature-list li {
        padding: 10px 12px !important;
        background: #fbfbfb !important;
        border-radius: 10px !important;
        margin-bottom: 8px !important;
        font-size: 13px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
    }

    .feature-list li strong {
        font-size: 13.5px !important;
    }


    .section-header {
        display: grid;
        grid-template-areas:
            "title btn"
            "subtitle subtitle";
        grid-template-columns: 1fr auto;
        gap: 4px 0;
        align-items: center;
        border-bottom: 2px solid var(--primary-color);
        margin-bottom: 15px;
        padding-bottom: 8px !important;
    }

    .section-title {
        grid-area: title;
        font-size: 20px;
    }

    .section-subtitle {
        grid-area: subtitle;
        display: block;
        font-size: 13px;
        color: var(--text-tertiary);
    }

    .section-subtitle::before {
        display: none;
    }

    .personal-site-btn {
        grid-area: btn;
        margin-left: 0;
        padding: 6px 12px;
        font-size: 13px;
    }

    .project-card {
        padding: 18px !important;
        margin-bottom: 5px !important;
    }

    .project-title {
        font-size: 17px !important;
        margin-bottom: 6px !important;
    }

    .project-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
    }

    .tag-container {
        gap: 6px !important;
        margin-top: auto !important;
    }
}

@media (max-width: 600px) {
    body {
        padding: 20px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        align-items: center;
    }

    .projects-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Project Intro Box */
.project-intro {
    background: rgba(255, 255, 255, 0.65);
    padding: 15px 20px;
    border-radius: var(--radius-m);
    border: var(--glass-border);
    backdrop-filter: blur(var(--blur-amt));
    -webkit-backdrop-filter: blur(var(--blur-amt));
    margin-bottom: 30px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-intro::before {
    content: '';
    font-size: 20px;
}

.project-intro strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* QR Modal Styles */
#qr-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    /* Use flex for perfectly centered content without transform conflicts */
    justify-content: center;
    align-items: center;
}

.qr-modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 85%;
    max-width: 320px;
    position: relative;
    /* Animation now only handles vertical slide since centering is flex-based */
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#qr-modal-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 12px;
}

@keyframes slideUpBottom {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}