/* ========================================
   Personal Website - DJI Inspired Theme
   ======================================== */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    background: #000;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .4s ease, color .4s ease;
}

/* Light Theme */
[data-theme="light"] body,
body[data-theme="light"] {
    background: #fff;
    color: #111;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px;
}

[data-theme="light"] .container { color: #111; }

/* =========== Header =========== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0; z-index: 1000;
    padding: 0;
    transition: background .3s ease, backdrop-filter .3s ease;
}
.header.scrolled {
    background: rgba(0,0,0,.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
[data-theme="light"] .header.scrolled {
    background: rgba(255,255,255,.82);
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
}
[data-theme="light"] .logo { color: #111; }

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,.7);
    transition: color .2s, background .2s;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
[data-theme="light"] .nav-link {
    color: rgba(0,0,0,.6);
}
[data-theme="light"] .nav-link:hover {
    color: #000;
    background: rgba(0,0,0,.05);
}
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all .3s;
}
[data-theme="light"] .nav-toggle span { background: #111; }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav { display: none; }
    .nav.open { display: block; }
    .nav-list {
        flex-direction: column;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,.95);
        backdrop-filter: blur(20px);
        padding: 80px 32px 32px;
        gap: 8px;
    }
    [data-theme="light"] .nav-list {
        background: rgba(255,255,255,.95);
    }
    .nav-link { font-size: 18px; padding: 14px 0; }
}

/* =========== Sections =========== */
.section { overflow: hidden; }
.section-social { overflow: visible; }
.section-social .container { padding-bottom: 8px; }

/* Hero */
.hero-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}
/* Hero 后面的组件向上贴近 */
.component:has(.hero-wrapper) + .component {
    margin-top: -80px;
    position: relative;
    z-index: 1;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.4);
}
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.6));
}
.hero-no-overlay .hero-bg::after {
    display: none;
}
.hero-no-overlay .hero-bg img {
    filter: none;
}
.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 800px;
}
.hero-title {
    font-size: clamp(36px, 8vw, 80px);
    font-weight: 200;
    letter-spacing: 4px;
    line-height: 1.15;
    margin-bottom: 16px;
}
.hero-subtitle {
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 300;
    letter-spacing: 2px;
    opacity: .75;
    margin-bottom: 40px;
}
.hero-cta {
    display: inline-block;
    padding: 14px 40px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 500;
    transition: all .3s;
}
.hero-cta:hover {
    background: #fff;
    color: #000;
}

/* Section Title */
.section-title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 200;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 60px;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: currentColor;
    margin: 20px auto 0;
    opacity: .3;
}

/* About */
.about-avatar { text-align: center; margin-bottom: 32px; }
.about-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.1);
}
.about-content { max-width: 700px; margin: 0 auto; text-align: center; font-size: 16px; opacity: .85; line-height: 2; }

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}
.service-card {
    padding: 40px 28px;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    text-align: center;
    transition: transform .3s, border-color .3s;
}
[data-theme="light"] .service-card {
    background: rgba(0,0,0,.02);
    border-color: rgba(0,0,0,.06);
}
.service-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.service-icon { font-size: 32px; margin-bottom: 16px; }
.service-card h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.service-desc {
    font-size: 0.85rem;
    opacity: .45;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}
.article-card {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    transition: transform .3s;
}
[data-theme="light"] .article-card {
    background: rgba(0,0,0,.02);
    border-color: rgba(0,0,0,.06);
}
.article-card:hover { transform: translateY(-4px); }
.article-cover { aspect-ratio: 16/9; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.article-card:hover .article-cover img { transform: scale(1.05); }
.article-info { padding: 20px; }
.article-date { font-size: 12px; opacity: .5; }
.article-title { font-size: 18px; font-weight: 500; margin: 8px 0; }
.article-summary { font-size: 14px; opacity: .65; line-height: 1.6; }

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    font-size: 14px;
    opacity: 0;
    transition: opacity .3s;
}
.gallery-item:hover .gallery-caption { opacity: 1; }

/* Contact */
.contact-wrapper {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color .3s;
}
[data-theme="light"] .contact-item {
    background: rgba(0,0,0,.02);
    border-color: rgba(0,0,0,.06);
}
.contact-item:hover { border-color: var(--accent); }

/* Custom */
.custom-content { max-width: 800px; margin: 0 auto; }

/* Spacer */
.spacer-block { margin: 0; padding: 0; border: none; background: transparent; }

/* Cards Grid */
.cards-grid {
    display: grid;
    gap: 24px;
}
.cards-cols-1 { grid-template-columns: 1fr; }
.cards-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards-cols-3 { grid-template-columns: repeat(3, 1fr); }

.card-block {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    padding: 0 0 28px;
    transition: transform .3s, border-color .3s;
}
.card-block:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.15); }
.card-image { overflow: hidden; }
.card-image img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    transition: transform .5s;
}
.card-block:hover .card-image img { transform: scale(1.05); }
.card-title {
    font-size: 18px;
    font-weight: 500;
    padding: 24px 20px 12px;
}
.card-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 24px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    transition: all .3s;
}
.card-btn:hover { background: #fff; color: #000; }

@media (max-width: 768px) {
    .cards-cols-2, .cards-cols-3 { grid-template-columns: 1fr; }
}

/* Social Links */
.social-grid {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 0;
}
.social-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    font-size: 12px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all .3s;
    cursor: default;
}
a.social-btn { cursor: pointer; }
.social-btn:hover {
    border-color: rgba(255,255,255,.4);
    background: rgba(255,255,255,.06);
}
.social-btn.has-qr::after {
    content: '';
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    position: absolute;
    top: 6px;
    right: 6px;
}
/* QR 弹窗 */
.social-qr-popup {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 140px;
    height: 140px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 100;
}
.social-qr-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}
.social-qr-popup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.social-item:hover .social-qr-popup {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 768px) {
    .social-grid { gap: 20px; }
    .social-btn { width: 48px; height: 48px; font-size: 11px; }
    .social-qr-popup { width: 120px; height: 120px; }
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 24px;
    font-size: 13px;
    opacity: .4;
    border-top: 1px solid rgba(255,255,255,.06);
}
[data-theme="light"] .footer { border-top-color: rgba(0,0,0,.06); }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0; z-index: 9999;
    background: rgba(0,0,0,.95);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox-close {
    position: absolute;
    top: 24px; right: 32px;
    background: none; border: none;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    opacity: .6;
    transition: opacity .2s;
}
.lightbox-close:hover { opacity: 1; }

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    backdrop-filter: blur(10px);
    transition: all .3s;
}
[data-theme="light"] .theme-toggle {
    background: rgba(0,0,0,.08);
    border-color: rgba(0,0,0,.1);
    color: #111;
}
.theme-toggle:hover { transform: scale(1.1); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner { padding: 0 20px; }
    .container { padding: 60px 20px; }
    .section-social .container { padding-bottom: 12px; }
    .hero-title { font-size: 36px; letter-spacing: 2px; }
    .hero-subtitle { font-size: 16px; }
    .services-grid { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
