/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --neon-green: #00ff41;
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --neon-orange: #ff9500;
    --dark-bg: #0a0e27;
    --terminal-bg: rgba(10, 14, 39, 0.95);
    --text-color: #00ff41;
    --shadow-color: rgba(0, 255, 65, 0.5);
}

body {
    font-family: 'Courier New', monospace;
    background: var(--dark-bg);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Matrix Rain Background */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

/* Terminal Container */
.terminal-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    background: var(--terminal-bg);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    box-shadow:
        0 0 20px var(--shadow-color),
        inset 0 0 50px rgba(0, 255, 65, 0.05);
    display: flex;
    flex-direction: column;
    animation: terminalGlow 2s ease-in-out infinite alternate;
    backdrop-filter: blur(10px);
}

@keyframes terminalGlow {
    from { box-shadow: 0 0 20px var(--shadow-color), inset 0 0 50px rgba(0, 255, 65, 0.05); }
    to { box-shadow: 0 0 30px var(--shadow-color), inset 0 0 60px rgba(0, 255, 65, 0.08); }
}

/* Terminal Header */
.terminal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--neon-green);
    border-radius: 6px 6px 0 0;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.header-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.btn-close { background: #ff5f56; box-shadow: 0 0 5px #ff5f56; }
.btn-minimize { background: #ffbd2e; box-shadow: 0 0 5px #ffbd2e; }
.btn-maximize { background: #27c93f; box-shadow: 0 0 5px #27c93f; }

.header-title {
    margin-left: auto;
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 14px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.6;
}

#terminal-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Custom Scrollbar */
.terminal-body::-webkit-scrollbar,
#terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track,
#terminal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb,
#terminal-content::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--shadow-color);
}

/* ASCII Logo */
.ascii-logo {
    color: var(--neon-cyan);
    text-align: center;
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--neon-cyan);
    animation: logoFlicker 3s infinite;
}

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

/* Boot Sequence */
.boot-sequence {
    margin-bottom: 20px;
}

.typing-text {
    margin: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--neon-green);
    animation: typing 1.5s steps(40, end), blink 0.75s step-end infinite;
}

.delay-1 { animation-delay: 0.5s; opacity: 0; animation-fill-mode: forwards; }
.delay-2 { animation-delay: 1s; opacity: 0; animation-fill-mode: forwards; }
.delay-3 { animation-delay: 1.5s; opacity: 0; animation-fill-mode: forwards; }

@keyframes typing {
    from { width: 0; opacity: 1; }
    to { width: 100%; opacity: 1; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--neon-green); }
}

/* Input Line */
.input-line {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
    padding-top: 10px;
}

.prompt {
    color: var(--neon-pink);
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-pink);
    white-space: nowrap;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    caret-color: var(--neon-green);
}

.cursor {
    width: 8px;
    height: 18px;
    background: var(--neon-green);
    animation: cursorBlink 1s infinite;
}

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

/* Terminal Footer */
.terminal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid var(--neon-green);
    font-size: 12px;
    border-radius: 0 0 6px 6px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 2s infinite;
}

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

.separator {
    color: rgba(0, 255, 65, 0.5);
}

/* Output Styles */
.output-line {
    margin: 8px 0;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.command-echo {
    color: var(--neon-cyan);
    margin-bottom: 5px;
}

.error {
    color: #ff4444;
    text-shadow: 0 0 5px #ff4444;
}

.success {
    color: var(--neon-green);
}

.info {
    color: var(--neon-orange);
}

.section-title {
    color: var(--neon-pink);
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
    text-shadow: 0 0 8px var(--neon-pink);
}

.paper-item {
    margin-left: 20px;
    margin-bottom: 10px;
    padding-left: 15px;
    border-left: 2px solid var(--neon-cyan);
}

.paper-title {
    color: var(--neon-cyan);
    font-weight: bold;
}

.paper-meta {
    color: rgba(0, 255, 65, 0.7);
    font-size: 12px;
    margin-top: 3px;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    text-shadow: 0 0 5px var(--neon-cyan);
    transition: all 0.3s;
}

a:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

/* Profile Section with Avatar */
.profile-section {
    display: flex;
    gap: 30px;
    margin-left: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-left {
    position: relative;
}

.avatar-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-cyan);
    animation: avatarGlow 2s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
    from { box-shadow: 0 0 20px var(--neon-cyan); }
    to { box-shadow: 0 0 30px var(--neon-cyan), 0 0 40px rgba(0, 255, 255, 0.5); }
}

.avatar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    animation: pulse 2s infinite;
    pointer-events: none;
}

.profile-right {
    flex: 1;
    min-width: 300px;
}

/* Enhanced Paper Items with Images */
.paper-item-enhanced {
    display: flex;
    gap: 20px;
    margin-left: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid var(--neon-cyan);
    border-radius: 5px;
    transition: all 0.3s;
}

.paper-item-enhanced:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.paper-image-container {
    flex-shrink: 0;
}

.paper-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid var(--neon-cyan);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: transform 0.3s;
}

.paper-image:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.paper-content {
    flex: 1;
}

/* First Author Highlight (独立第一作者) */
.first-author {
    color: var(--neon-pink);
    font-weight: bold;
    text-shadow: 0 0 8px var(--neon-pink);
    background: rgba(255, 0, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    position: relative;
}

.first-author sup {
    color: var(--neon-orange);
    font-weight: bold;
    margin-left: 2px;
}

/* Co-First Author Highlight (共同一作) */
.co-first-author {
    color: var(--neon-cyan);
    font-weight: bold;
    text-shadow: 0 0 8px var(--neon-cyan);
    background: rgba(0, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    position: relative;
}

.co-first-author sup {
    color: var(--neon-orange);
    font-weight: bold;
    margin-left: 2px;
}

/* Regular Author Highlight (非一作) */
.author-highlight {
    color: var(--neon-green);
    font-weight: 500;
}

/* Timeline Items for Education & Experience */
.timeline-item {
    margin-left: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 65, 0.05);
    border-left: 3px solid var(--neon-cyan);
    border-radius: 5px;
    transition: all 0.3s;
}

.timeline-item:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.timeline-title {
    color: var(--neon-pink);
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 8px var(--neon-pink);
}

.timeline-period {
    color: var(--neon-orange);
    font-size: 13px;
    font-weight: bold;
    background: rgba(255, 149, 0, 0.1);
    padding: 3px 10px;
    border-radius: 3px;
}

.timeline-content {
    margin-top: 8px;
    line-height: 1.8;
}

/* Competition Items */
.competition-item {
    margin-left: 20px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid var(--neon-orange);
    border-radius: 5px;
    transition: all 0.3s;
}

.competition-item:hover {
    background: rgba(0, 255, 255, 0.1);
    border-left-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 149, 0, 0.2);
}

.competition-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.competition-name {
    color: var(--neon-cyan);
    font-weight: bold;
    font-size: 15px;
}

.competition-year {
    color: var(--neon-orange);
    font-size: 12px;
    font-weight: bold;
    background: rgba(255, 149, 0, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
}

.competition-award {
    color: var(--neon-pink);
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 0 0 5px var(--neon-pink);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.5);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
    border-color: var(--neon-cyan);
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 10px;
    color: var(--neon-cyan);
    font-size: 12px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 65, 0.1);
    color: var(--neon-green);
    font-size: 14px;
}

/* CRT Effect */
.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    pointer-events: none;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 90vh;
    }

    .terminal-body {
        font-size: 12px;
        padding: 15px;
    }

    .ascii-logo {
        font-size: 10px;
    }

    .header-title {
        font-size: 10px;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .avatar-container,
    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .paper-item-enhanced {
        flex-direction: column;
    }

    .paper-image {
        width: 100%;
        height: auto;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        margin: 15px;
    }

    .gallery-image {
        height: 150px;
    }
}