:root {
    --bg-color: #f7f7f7;
    --text-main: #1a1a1a;
    --text-muted: #888;
    --accent: #ff4a3a;
    --grid-line: #e2e2e2;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Background Grid Lines */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background-image: 
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 5vw 5vw;
    opacity: 0.6;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(247, 247, 247, 0.7);
    backdrop-filter: blur(2px);
    border-left: 1px solid var(--grid-line);
    border-right: 1px solid var(--grid-line);
}

.section {
    padding: 5vw 4vw;
    border-bottom: 1px solid var(--grid-line);
}

/* Placeholder styles */
.placeholder {
    background-color: #e8e8e8;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px dashed #ccc;
}
.placeholder::after {
    content: 'IMAGE PLACEHOLDER';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a0a0a0;
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    z-index: 0;
}

/* =========================================================
   GLOBAL IMAGE BEHAVIOR (SMART AUTO-COVER)
   ========================================================= */

/* 1. Base container settings (allows original varied sizes like 16:9, 4:3, 21:9 to work) */
.project-image,
.profile-image,
.qr,
.hero-image,
.content-image,
.feature-image,
.feature-img-small,
.placeholder {
    position: relative;
    overflow: hidden;
    /* Removed the forced 1:1 so it respects inline styles and original CSS shapes! */
}

/* 2. If user replaces the placeholder div entirely with an <img class="..."> tag */
img.project-image,
img.profile-image,
img.qr,
img.hero-image,
img.content-image,
img.feature-image,
img.feature-img-small,
img.placeholder {
    width: 100%;
    object-fit: cover !important;
    display: block !important;
}

/* 3. SMART IMAGE WRAPPING (NO CROPPING FOR CONTENT IMAGES) */
/* When an image is nested, let it dictate the natural height so it never crops,
   EXCEPT for .project-image which must stay a 1:1 square. */

/* Reset wrapper heights to auto if they contain an image */
.profile-image:has(img),
.qr:has(img),
.hero-image:has(img),
.content-image:has(img),
.feature-image:has(img),
.feature-img-small:has(img),
.placeholder:not(.project-image):has(img) {
    height: auto !important;
    aspect-ratio: auto !important; /* overrides inline styles like 16/9 or 21/9 */
}

/* Make nested images natural height without absolute positioning */
.profile-image img,
.qr img,
.hero-image img,
.content-image img,
.feature-image img,
.feature-img-small img,
.placeholder:not(.project-image) img {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Keep .project-image exactly as 1:1 square with absolute cover */
.project-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* HEADER */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 10vw;
    padding-bottom: 8vw;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.logo-mark {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.logo-pill {
    width: 25px;
    height: 60px;
    background-color: #000;
    border-radius: 20px;
}
.logo-pill.small {
    height: 45px;
}
.logo-p {
    display: flex;
    align-items: flex-end;
    margin-left: -5px;
}

.logo-text {
    text-align: left;
    line-height: 1;
}

.logo-text .year {
    font-size: 1.8rem;
    font-weight: 300;
    color: #c0c0c0;
    letter-spacing: 12px;
    display: block;
    margin-bottom: 5px;
}

.logo-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    margin: 0;
}

.logo-text h1 .dot {
    color: var(--accent);
}

.header-subtitle {
    color: var(--text-muted);
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: lowercase;
}
.header-subtitle strong {
    color: var(--text-main);
    font-weight: 500;
}

/* SECTION HEADERS */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--grid-line);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 300;
}

.section-meta {
    font-weight: 300;
    letter-spacing: 8px;
    color: #c0c0c0;
    font-size: 0.9rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 300;
}

/* PROJECTS GRID */
.projects-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.projects-grid::-webkit-scrollbar {
    height: 6px;
}
.projects-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.project-card {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.project-number {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.project-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* 单独为顶部的项目卡片设置正方形 (完美适配1500*1500) */
    height: auto; /* 移除之前固定的220px高度 */
    margin-bottom: 1rem;
    border-radius: 16px;
}

.project-name {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 500;
    padding-right: 0.5rem;
}

/* RESUME SECTION */
.resume-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
}

.profile-image {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.about-me h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.about-me p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.hello-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}
.hello-btn:hover {
    background: #333;
}

.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--grid-line);
}

.resume-header h2 {
    font-size: 2.2rem;
    font-weight: 300;
}

.resume-meta {
    font-size: 0.85rem;
    color: var(--text-main);
}

.resume-details {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
}

.resume-col h3 {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.timeline, .achievements-list, .skills-list {
    list-style: none;
    margin-bottom: 3rem;
}

.timeline li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 6px;
    height: 6px;
    border: 1.5px solid #000;
    border-radius: 50%;
}

.timeline li strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.timeline li span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.achievements-list li {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.achievements-list li::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: #e0e0e0;
    border-radius: 4px;
    flex-shrink: 0;
}

.skills-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.skills-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.skills-list li::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #000;
    border-radius: 3px;
    opacity: 0.8;
}

.contact-section p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.qr-codes {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.qr {
    width: 70px;
    height: 70px;
    border-radius: 8px;
}
.qr::after {
    content: 'QR';
    font-size: 0.7rem;
}

/* PROJECT DETAIL */
.hero-image {
    width: 100%;
    height: 60vh;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.project-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 1rem 0;
}

.project-meta-bar strong {
    color: var(--text-main);
    font-weight: 500;
}

.duration {
    background: #000;
    color: #fff;
    padding: 0.3rem 1.2rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.content-text h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.content-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

.content-image {
    width: 100%;
    border-radius: 20px;
}

/* FEATURE GRID */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    display: flex;
    flex-direction: column;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--grid-line);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.feature-header h4 {
    font-weight: 500;
}

.feature-header span {
    font-size: 0.8rem;
    color: var(--accent);
}

.feature-card h5 {
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.feature-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
}

.drone-feature-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    border: 1px solid var(--grid-line);
}

@media (max-width: 900px) {
    .resume-grid {
        grid-template-columns: 1fr;
    }
    .profile-image {
        max-width: 300px;
        margin: 0 auto 2rem;
    }
    .resume-details {
        grid-template-columns: 1fr;
    }
    .content-grid {
        grid-template-columns: 1fr !important;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .features-row {
        flex-direction: column;
    }
    .section-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}
