/* Index Page Specific Styles */

/* Section spacing */
.section {
    padding: 6rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 4rem;
    text-align: center;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Featured Project Section */
.featured-section {
    padding-top: 4rem;
    padding-bottom: 8rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.featured-card-container {
    transition: transform 0.1s ease-out, box-shadow 0.4s ease, border-color 0.4s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.about-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.about-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2.5rem;
    margin: 0;
}

.block-icon {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.expertise-grid {
    display: grid;
    gap: 1.5rem;
    border: 100px;
}

.expertise-item {
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
}

.skill-name {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.2rem;
}

.stats-grid-modern {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 2rem;
    animation-timeline: view();
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(121, 40, 202, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse 5s infinite alternate;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.hero-content h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right bottom, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-content h1 span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    fill: transparent;
    transition: all 1s ease-in-out;
    display: inline-flex;
    align-items: center;
}

.hero-content p {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 0, 128, 0.8);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* 悬浮时的毛玻璃发光光效层 */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                              rgba(255, 255, 255, 0.15) 0%, 
                              transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 1;
}

.card:hover::before {
    opacity: 1;
}

/* Scroll-Driven 加载动画 */
@keyframes card-reveal {
    from {
        opacity: 0;
        transform: translateY(100px) scale(0.3) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.card {
    view-timeline-name: --card-reveal;
    view-timeline-axis: block;
    animation: card-reveal linear both;
    animation-timeline: --card-reveal;
    animation-range: entry 0% cover 30%;
}

/* 个人信息卡片特有样式 */
.profile-card {
    max-width: 400px;
    margin: 4rem auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
}

.profile-card.flying {
    animation: fly-to-camera 1.2s forwards cubic-bezier(0.5, 0, 0.5, 1);
    z-index: 10000;
    pointer-events: none;
}

@keyframes fly-to-camera {
    0% {
        transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) translateZ(0) scale(1.05);
    }
    100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(1000px) scale(10);
        opacity: 0;
    }
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    box-shadow: 0 0 20px rgba(70, 197, 255, 0.5);
    object-fit: cover;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-title {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 600;
}

.profile-title span {
    color: var(--accent);
}

.profile-quote {
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* 确保内容在光效层之上 */
.card > * {
    position: relative;
    z-index: 2;
    pointer-events: none; /* 允许鼠标事件穿透到父级 card */
}

.card a, .card button {
    pointer-events: auto; /* 链接和按钮需要恢复点击 */
}

/* About Section Modern Layout */
.about-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.about-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2.5rem;
}

.block-icon {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.expertise-grid {
    display: grid;
    gap: 1.5rem;
    border: 100px;
}

.expertise-item {
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
}

.skill-name {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.2rem;
}

.stats-grid-modern {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Highlight Project Card */
.highlight-card {
    position: relative;
    padding: 0;
    border-radius: 30px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Scroll Driven Animation Initial State */
    view-timeline-name: --highlight-reveal;
    animation: highlight-fly-in linear both;
    animation-timeline: --highlight-reveal;
    animation-range: entry 0% cover 40%;
}

@keyframes highlight-fly-in {
    from {
        opacity: 0;
        transform: translateY(100px) rotateX(-20deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

.highlight-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(70, 197, 255, 0.4);
    transform: scale(1.02);
}

.highlight-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--accent);
    border: 1px solid var(--accent);
    z-index: 5;
}

.highlight-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.highlight-info {
    padding: 1.5rem 2rem;
    background: linear-gradient(to top, rgba(18, 0, 36, 0.9), transparent);
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: left;
}

.highlight-info h4 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
    color: #fff;
}

.highlight-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Spiral Animation */
.highlight-card.spiraling {
    animation: spiral-fly-to-camera 1.5s forwards cubic-bezier(0.5, 0, 0.5, 1);
    z-index: 10001;
    pointer-events: none;
}

@keyframes spiral-fly-to-camera {
    0% {
        transform: perspective(1000px) rotateX(0) rotateY(0) rotateZ(0) translateZ(0) scale(1);
    }
    100% {
        transform: perspective(1000px) rotateX(360deg) rotateY(720deg) rotateZ(180deg) translateZ(1500px) scale(8);
        opacity: 0;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .about-container {
        grid-template-columns: 1fr;
    }
    .stats-grid-modern {
        grid-column: span 1;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-desc {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent);
}

/* Tech Stacks Section */
.techstacks-section {
    padding: 6rem 5%;
}

.techstacks-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.techstacks-triangle {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 900px;
    gap: 1.5rem;
}

.techstacks-triangle .tech-icon {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(200px) scale(0.5);
    animation-timeline: view();
    transition: none;
}

.techstacks-triangle .tech-icon img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(70, 197, 255, 0.3));
}

.techstacks-triangle .tech-icon.reveal {
    opacity: 0;
    transform: translateX(300px) scale(0.3) rotate(20deg);
    transition: none;
    animation: none;
}

.techstacks-triangle .tech-icon.reveal.active {
    animation: tech-fly-in 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    animation-delay: calc(var(--delay) * 0.1s);
}

@keyframes tech-fly-in {
    0% {
        opacity: 0;
        transform: translateX(300px) scale(0.3) rotate(20deg);
    }
    60% {
        opacity: 0.8;
        transform: translateX(-20px) scale(1.1) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1) rotate(0deg);
    }
}

.techstacks-triangle .tech-icon:hover {
    transform: scale(1.15) translateY(-10px);
    background: aliceblue;
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(70, 197, 255, 0.4);
    transition: all 0.3s ease;
}

.techstacks-triangle .tech-icon.reveal:hover {
    transform: scale(1.15) translateY(-10px);
}

@media (max-width: 768px) {
    .techstacks-triangle {
        gap: 1rem;
    }
    .techstacks-triangle .tech-icon {
        width: 80px;
        height: 80px;
    }
    .techstacks-triangle .tech-icon img {
        width: 55px;
        height: 55px;
    }
}

/* Footer & Turbine Animation */
footer {
    padding: 8rem 0 4rem;
    text-align: center;
    position: relative;
    background: linear-gradient(to bottom, transparent, #000);
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.turbine-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    cursor: pointer;
}

.avatar-box {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 10;
    border: 4px solid var(--accent);
    box-shadow: 0 0 50px #3473cc;
    position: relative;
    background: #0cffa1;
}

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

/* 涡轮叶片 - 动态生成 */
.turbine-blade {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 5%;
    transform-origin: center;
    box-shadow: 0 0 30px rgba(121, 40, 202, 0.8);
    transition: all 0.2s ease;
}

.turbine-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed var(--accent);
    opacity: 0.3;
}

/* 动态生成的叶片样式，通过JS控制 */
.turbine-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
}

.outer-ring {
    width: 280px;
    height: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--primary);
    border-radius: 50%;
    position: absolute;
    animation: reverse-spin 15s linear infinite;
}

#footertitle {
    color: rgba(255,255,255,0.6);
}

#footertext {
    margin-top: 3rem; font-size: 1.4rem; color: rgba(255,255,255,0.3);
}

.social-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.social-btn {
    width: 100px;
    height: 50px;
    border-radius: 25px;
    background: var(--glass);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.social-btn:hover {
    background: var(--primary);
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 0 20px var(--primary);
}

/* 响应式媒体查询 */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 4rem;
    }
    .section {
        padding: 6rem 5%;
    }
    .about-grid {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 1rem 5%;
    }
    .nav-links {
        display: none; /* 简化移动端导航 */
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 2.5rem;
    }
    .stats-container {
        grid-template-columns: 1fr 1fr;
    }
    .turbine-container {
        width: 250px;
        height: 250px;
    }
    .avatar-box {
        width: 100px;
        height: 100px;
    }
    .outer-ring {
        width: 230px;
        height: 230px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 2rem;
    }
    .btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    .cursor {
        width: 10px;
        height: 3px;
    }
}
