/* ==================== CSS Variables ==================== */
:root {
    --primary-color: #00f3ff;
    --secondary-color: #0066ff;
    --dark-bg: #0a0e27;
    --darker-bg: #060816;
    --card-bg: rgba(15, 20, 45, 0.8);
    --text-color: #e0e6ff;
    --text-secondary: #a0b0d0;
    --glow-color: rgba(0, 243, 255, 0.5);
    --border-radius: 12px;
}

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--darker-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ==================== Canvas Background ==================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
}

/* ==================== Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ==================== Section Styles ==================== */
section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.title-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--primary-color));
}

/* ==================== Hero Section ==================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    width: 100%;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.glitch-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--glow-color);
    margin-bottom: 10px;
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        text-shadow: 
            0 0 10px var(--primary-color),
            0 0 20px var(--primary-color),
            0 0 40px var(--glow-color);
    }
    92% {
        text-shadow: 
            2px 0 0 #ff00de,
            -2px 0 0 #00f3ff;
        transform: translate(-2px, 0);
    }
    94% {
        text-shadow: 
            -2px 0 0 #ff00de,
            2px 0 0 #00f3ff;
        transform: translate(2px, 0);
    }
}

.name-en {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 5px;
    margin-bottom: 30px;
}

.typing-container {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 40px;
    min-height: 45px;
}

.typing-text {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 400;
}

.cursor {
    font-weight: 300;
    animation: blink 0.7s infinite;
    color: var(--primary-color);
}

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

.hero-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    padding: 10px 15px;
    background: rgba(0, 243, 255, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 5px;
}

.icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* ==================== Hero Image Styles ==================== */
.hero-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    position: relative;
    width: 280px;
    height: 280px;
}

.profile-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 0 20px var(--primary-color),
        0 0 40px var(--glow-color),
        0 0 60px rgba(0, 243, 255, 0.2);
    border: 4px solid var(--primary-color);
    animation: photoGlow 3s ease-in-out infinite;
}

@keyframes photoGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--primary-color),
            0 0 40px var(--glow-color),
            0 0 60px rgba(0, 243, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px var(--primary-color),
            0 0 60px var(--glow-color),
            0 0 90px rgba(0, 243, 255, 0.3);
    }
}

/* Rotating Border Effect */
.rotating-border {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--primary-color) 90deg,
        transparent 180deg,
        var(--secondary-color) 270deg,
        transparent 360deg
    );
    z-index: 1;
    animation: rotate 4s linear infinite;
    opacity: 0.6;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scan Line Effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary-color) 50%, 
        transparent 100%
    );
    z-index: 3;
    animation: scan 3s ease-in-out infinite;
    box-shadow: 0 0 10px var(--primary-color);
}

@keyframes scan {
    0%, 100% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ==================== Scroll Indicator ==================== */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    position: relative;
    box-shadow: 0 0 10px var(--glow-color);
}

.wheel {
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: wheel 2s infinite;
}

@keyframes wheel {
    0%, 100% {
        top: 10px;
        opacity: 1;
    }
    50% {
        top: 25px;
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.scroll-indicator p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ==================== About Section ==================== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.about-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glow-color);
    border-color: var(--primary-color);
}

.about-card.full-width {
    grid-column: 1 / -1;
}

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

.card-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.card-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-content {
    color: var(--text-secondary);
}

.university {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.major {
    font-size: 1rem;
    margin-bottom: 8px;
}

.gpa {
    font-size: 1rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.interest-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.interest-list li {
    padding-left: 25px;
    position: relative;
    font-size: 1rem;
}

.interest-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.language-item:last-child {
    border-bottom: none;
}

.lang-name {
    font-size: 1.05rem;
    color: var(--text-color);
}

.lang-badge {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--primary-color);
}

.lang-badge.native {
    background: rgba(0, 243, 255, 0.2);
    font-weight: 600;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.course-tag {
    background: rgba(0, 243, 255, 0.05);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.course-tag:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
}

/* ==================== Skills Section ==================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glow-color);
    border-color: var(--primary-color);
}

.skill-category.full-width {
    grid-column: 1 / -1;
}

.category-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 243, 255, 0.2);
}

.skill-item {
    margin-bottom: 25px;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-name {
    font-size: 1.05rem;
    color: var(--text-color);
    font-weight: 500;
}

.skill-percentage {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 243, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 243, 255, 0.1);
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease;
    box-shadow: 0 0 15px var(--glow-color);
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tool-tag {
    background: rgba(0, 243, 255, 0.1);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 25px;
    border: 1px solid var(--primary-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tool-tag:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 20px var(--glow-color);
    transform: scale(1.05);
}

.lab-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.lab-skill-tag {
    background: rgba(0, 243, 255, 0.05);
    color: var(--text-color);
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.lab-skill-tag:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.instrument-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.instrument-card {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.instrument-card:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
    transform: translateY(-5px);
}

.instrument-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.instrument-card p {
    color: var(--text-color);
    font-size: 0.95rem;
}

/* ==================== Experience Section ==================== */
.timeline {
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px var(--glow-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -38px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid var(--dark-bg);
    box-shadow: 0 0 20px var(--glow-color);
    z-index: 2;
}

.timeline-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px var(--glow-color);
    border-color: var(--primary-color);
}

.exp-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.exp-role {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid var(--primary-color);
}

.exp-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.exp-description p {
    margin-bottom: 10px;
}

.exp-description strong {
    color: var(--text-color);
}

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

.exp-tag {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 243, 255, 0.3);
}

/* ==================== Activities Section ==================== */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.activity-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.activity-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--glow-color);
    border-color: var(--primary-color);
}

.activity-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--primary-color));
}

.activity-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.activity-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.activity-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(0, 243, 255, 0.1);
    color: var(--text-color);
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 243, 255, 0.3);
}

/* ==================== Contact Section ==================== */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--glow-color);
}

.contact-button:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 40px var(--primary-color);
    transform: scale(1.05);
}

.button-icon {
    font-size: 1.5rem;
}

.contact-location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.location-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* ==================== Footer ==================== */
.footer {
    background: var(--darker-bg);
    border-top: 1px solid rgba(0, 243, 255, 0.1);
    padding: 40px 0;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.footer-tagline {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 968px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-info {
        align-items: center;
    }

    .glitch-text {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline {
        padding-left: 40px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }

    .glitch-text {
        font-size: 2.5rem;
    }

    .name-en {
        font-size: 1.2rem;
    }

    .typing-container {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }

    .about-grid,
    .skills-grid,
    .activities-grid {
        grid-template-columns: 1fr;
    }

    .hero-image .image-container {
        width: 220px;
        height: 220px;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-marker {
        left: -33px;
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .glitch-text {
        font-size: 2rem;
    }

    .name-en {
        font-size: 1rem;
        letter-spacing: 3px;
    }

    .typing-container {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }

    .hero-image .image-container {
        width: 200px;
        height: 200px;
    }

    .about-card,
    .skill-category,
    .timeline-content,
    .activity-card {
        padding: 20px;
    }

    .contact-button {
        padding: 15px 30px;
        font-size: 1rem;
    }
}

/* ==================== Scroll Animation ==================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}