/* ==========================================================================
   CYBERSPACE PORTFOLIO STYLES
   ========================================================================== */

:root {
    --bg-dark: #080a11;
    --bg-card: rgba(15, 20, 32, 0.55);
    --bg-card-hover: rgba(25, 32, 50, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 243, 255, 0.3);
    
    --accent-cyan: #00f3ff;
    --accent-purple: #a855f7;
    --accent-pink: #ff007f;
    --accent-blue: #3b82f6;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --font-heading: 'Space Grotesk', 'Noto Sans SC', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;
    
    --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
}

body {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Selection */
::selection {
    background: var(--accent-cyan);
    color: #000;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ==========================================================================
   WebGL & Background & Cursor
   ========================================================================== */

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1.5px solid rgba(0, 243, 255, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease-out, border-color 0.2s ease;
}

/* Cursor Hover states */
body.hovering .cursor-dot {
    transform: translate(-50%, -50%) scale(1.8);
    background-color: var(--accent-pink);
}
body.hovering .cursor-outline {
    transform: translate(-50%, -50%) scale(1.4);
    border-color: var(--accent-pink);
}

/* ==========================================================================
   Glassmorphism Card Effect
   ========================================================================== */

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

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

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 12px 40px 0 rgba(0, 243, 255, 0.15);
}

/* Tilt Card */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.highlight {
    color: var(--accent-cyan);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(0, 243, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    font-family: var(--font-heading);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #040814;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.7);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-3px);
}

.btn-block {
    width: 100%;
}

/* Section Header */
.section {
    padding: 100px 5%;
    max-width: 1300px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.section-title .number {
    color: var(--accent-cyan);
    font-weight: 400;
    margin-right: 8px;
}

.section-line {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.5), transparent);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition-fast);
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(8, 10, 17, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
}

.logo-icon {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
    padding: 5px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-cyan);
    transition: var(--transition-fast);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    min-height: 100vh;
    padding: 140px 5% 60px 5%;
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 40px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.typing-container {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.typing-text {
    color: var(--accent-cyan);
    font-weight: 600;
    margin-left: 6px;
}

.cursor-blink {
    color: var(--accent-pink);
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 30px;
}

.stat-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.stat-info h3 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.about-text {
    padding: 40px;
}

.highlight-p {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.feature-item i {
    font-size: 1.4rem;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.15);
    padding: 12px;
    border-radius: 12px;
    margin-top: 2px;
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.feature-item p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.about-card-3d {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.avatar-box {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-glow {
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    animation: rotateGlow 8s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.avatar-icon {
    font-size: 4rem;
    color: var(--accent-cyan);
    position: relative;
    z-index: 1;
}

.avatar-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.avatar-tag {
    color: var(--accent-pink);
    font-size: 0.9rem;
    margin-bottom: 24px;
    font-family: var(--font-heading);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.social-icon:hover {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
    box-shadow: 0 0 15px var(--accent-cyan);
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.skill-card {
    padding: 35px 30px;
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.skill-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-cyan {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.icon-purple {
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.icon-pink {
    color: var(--accent-pink);
    background: rgba(255, 0, 127, 0.1);
    border: 1px solid rgba(255, 0, 127, 0.2);
}

.skill-header h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

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

.skill-tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.skill-card:hover .skill-tag {
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--text-main);
    background: rgba(0, 243, 255, 0.06);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-image-box {
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1), rgba(168, 85, 247, 0.1));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.project-preview-icon {
    font-size: 4rem;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 15px var(--accent-cyan));
    transition: var(--transition-smooth);
}

.project-card:hover .project-preview-icon {
    transform: scale(1.2) rotate(10deg);
}

.project-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-category {
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-tech span {
    font-size: 0.78rem;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-card {
    padding: 50px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-header {
    text-align: center;
    margin-bottom: 40px;
}

.contact-header h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.contact-header p {
    color: var(--text-muted);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.input-group {
    position: relative;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
    font-family: var(--font-body);
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-dim);
    transition: var(--transition-fast);
    pointer-events: none;
    font-size: 0.95rem;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group input:not(:placeholder-shown),
.input-group textarea:not(:placeholder-shown) {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.input-group input:focus ~ label,
.input-group textarea:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    background: #080a11;
    padding: 0 6px;
    border-radius: 4px;
}

/* ==========================================================================
   Footer & ICP Beian Link
   ========================================================================== */

.footer {
    background: rgba(5, 7, 12, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 40px 5%;
    margin-top: 60px;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand p {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin-top: 6px;
}

.footer-icp {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.icp-link-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.icp-icon {
    color: var(--accent-cyan);
    font-size: 0.9rem;
}

.icp-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
}

.icp-link:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.08);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-section {
        grid-template-columns: 1fr;
        padding-top: 120px;
        text-align: center;
    }
    .hero-subtitle {
        margin: 0 auto 2.5rem auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .typing-container {
        justify-content: center;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .nav-links {
        display: none;
    }
    .nav-toggle {
        display: block;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-icp {
        text-align: center;
    }
    .icp-link-container {
        justify-content: center;
    }
}
