/* ===== Tech/Cyberpunk Style CSS for Academic Homepage ===== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary-color: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.6);
    --secondary-color: #7b2fff;
    --accent-color: #ff2d95;
    --dark-bg: #0a0a0f;
    --card-bg: rgba(10, 15, 30, 0.85);
    --card-border: rgba(0, 212, 255, 0.15);
    --text-primary: #e0e8f0;
    --text-secondary: #8899aa;
    --text-muted: #556677;
    --gradient-1: linear-gradient(135deg, #0a0a0f 0%, #0d1b2a 50%, #0a0a0f 100%);
    --gradient-2: linear-gradient(135deg, #00d4ff 0%, #7b2fff 100%);
    --gradient-3: linear-gradient(135deg, #ff2d95 0%, #7b2fff 100%);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 212, 255, 0.3);
}

/* ===== Global Background ===== */
body {
    background: var(--dark-bg);
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(123, 47, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 45, 149, 0.03) 0%, transparent 60%);
    background-size: 60px 60px, 60px 60px, 100% 100%, 100% 100%, 100% 100%;
    background-attachment: fixed;
    font-family: 'Rajdhani', 'Microsoft YaHei', Georgia, sans-serif;
    color: var(--text-primary);
    padding-bottom: 8px;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Animated Scan Line ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 212, 255, 0.008) 2px,
            rgba(0, 212, 255, 0.008) 4px);
    pointer-events: none;
    z-index: 9999;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ===== Canvas for Particles ===== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== Container ===== */
.container {
    width: 980px;
    min-height: 1000px;
    max-height: 999999px;
    margin: 56px auto 20px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow-glow), var(--shadow-card);
    padding: 20px 24px;
    position: relative;
    z-index: 1;
}

.container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), transparent, rgba(123, 47, 255, 0.3)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: borderGlow 4s ease-in-out infinite;
}

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

/* ===== Links ===== */
a, a>tt {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

a:visited {
    color: #00a8cc;
}

/* ===== Headings ===== */
h1, h2, h3 {
    color: #fff;
    margin-top: 0.7em;
    margin-bottom: 0.3em;
    padding-bottom: 0.2em;
    line-height: 1.0;
    padding-top: 0.5em;
    border-bottom: none;
    position: relative;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1 {
    font-size: 165%;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 125%;
    padding-top: 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid rgba(0, 212, 255, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--gradient-2);
    border-radius: 2px;
    animation: headingLine 3s ease-in-out infinite;
}

@keyframes headingLine {
    0%, 100% { width: 80px; opacity: 0.6; }
    50% { width: 160px; opacity: 1; }
}

h2 .fa {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    animation: iconPulse 2s ease-in-out infinite;
    font-size: 1.1em;
}

@keyframes iconPulse {
    0%, 100% { text-shadow: 0 0 10px var(--primary-glow); }
    50% { text-shadow: 0 0 25px var(--primary-glow), 0 0 40px rgba(0, 212, 255, 0.4); }
}

h2+h3 {
    padding-top: 0.2em;
}

h3 {
    font-size: 110%;
    border-bottom: none;
}

/* ===== Anchor ===== */
a.anchor {
    display: block;
    position: relative;
    top: -38px;
    visibility: hidden;
}

/* ===== Image Table ===== */
table.imgtable, table.imgtable td {
    border: none;
    text-align: left;
}

table.imgtable td:first-child {
    padding-right: 20px;
}

table.imgtable img {
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3), 0 0 60px rgba(123, 47, 255, 0.2);
    border: 2px solid rgba(0, 212, 255, 0.3);
    transition: all 0.5s ease;
}

table.imgtable img:hover {
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.5), 0 0 80px rgba(123, 47, 255, 0.4);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* ===== Name/Title ===== */
table.imgtable a font[size="4"] {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

/* ===== Staff Shortcut Nav ===== */
class[class="staffshortcut"] a,
.staffshortcut a,
a[href^="#"] {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.staffshortcut a:hover,
a[href^="#"]:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

/* ===== Lists ===== */
ul, ol, dl {
    margin-top: 0.2em;
    padding-top: 0.2em;
    margin-bottom: 0.8em;
    color: var(--text-primary);
}

ul {
    list-style-position: outside;
    list-style-type: none;
}

ul li {
    margin: 0.3em;
    padding: 6px 10px;
    position: relative;
    padding-left: 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

ul li::before {
    content: '›';
    position: absolute;
    left: 4px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

ul li:hover {
    background: rgba(0, 212, 255, 0.03);
    border-left: 2px solid var(--primary-color);
}

/* ===== Latest News ===== */
#latestnews li {
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    margin: 8px 0;
    padding: 10px 15px 10px 25px;
    transition: all 0.3s ease;
}

#latestnews li:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

#latestnews li b font[color="#FF0000"] {
    color: var(--accent-color) !important;
    text-shadow: 0 0 8px rgba(255, 45, 149, 0.5);
}

/* ===== Research Interest Cards ===== */
ul > li > b > font[style*="font-size: 18px"] {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    display: block;
    margin-bottom: 10px;
}

/* ===== Details / Summary ===== */
details {
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 10px 0;
    transition: all 0.3s ease;
}

details:hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}

details summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    padding: 5px;
    transition: all 0.2s ease;
}

details summary:hover {
    text-shadow: 0 0 8px var(--primary-glow);
}

details[open] {
    background: rgba(0, 212, 255, 0.05);
}

/* ===== Panels ===== */
.panel {
    margin-bottom: 20px;
    background-color: rgba(0, 212, 255, 0.05) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: rgba(0, 212, 255, 0.4) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.panel-default {
    border-color: rgba(0, 212, 255, 0.2) !important;
}

.panel-default>.panel-heading {
    color: var(--primary-color) !important;
    background-color: rgba(0, 212, 255, 0.08) !important;
    border-color: rgba(0, 212, 255, 0.2) !important;
    border-radius: 8px 8px 0 0;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: var(--primary-color);
    font-family: 'Rajdhani', sans-serif;
}

.panel-body {
    padding: 15px;
}

/* ===== Mark / Highlight ===== */
mark {
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary-color);
    padding: 1px 4px;
    border-radius: 2px;
}

font[color="#FF0000"] {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* ===== Images in content ===== */
img {
    border: none;
}

div[align="center"] img {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.1);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

div[align="center"] img:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.2);
    transform: scale(1.02);
}

/* ===== Back to Top ===== */
#back_top {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.8), rgba(123, 47, 255, 0.8));
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: block;
    cursor: pointer;
    position: fixed;
    right: 30px;
    bottom: 25px;
    display: none;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

#back_top:hover {
    box-shadow: 0 0 35px rgba(0, 212, 255, 0.7);
    transform: translateY(-3px);
}

.arrow {
    border: 9px solid transparent !important;
    border-bottom-color: #fff !important;
    width: 0px;
    height: 0px;
    top: 0px;
}

.stick {
    width: 8px;
    height: 14px;
    border-radius: 1px;
    background-color: #fff;
    top: 15px;
}

#back_top div {
    position: absolute;
    margin: auto;
    right: 0px;
    left: 0px;
}

/* ===== Tables ===== */
table {
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-collapse: collapse;
}

td {
    padding: 2px;
    padding-left: 0.5em;
    padding-right: 0.5em;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

/* ===== Paragraphs ===== */
p {
    width: 100%;
    margin-top: 0.0em;
    margin-bottom: 0.8em;
    padding: 0;
    line-height: 1.5;
}

/* ===== Font styles ===== */
font[size="3"] {
    color: var(--text-primary);
}

b {
    color: #fff;
}

i {
    color: var(--text-secondary);
}

/* ===== Section-specific styling ===== */
ul > li > b {
    color: var(--primary-color);
}

/* ===== Publications list ===== */
p[style*="text-indent"] span {
    transition: all 0.3s ease;
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
}

p[style*="text-indent"] span:hover {
    background: rgba(0, 212, 255, 0.03);
}

/* ===== Footer / Bottom ===== */
div[align="center"] img[alt=""] {
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: all 0.5s ease;
}

div[align="center"] img[alt=""]:hover {
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

/* ===== Iframe ===== */
iframe {
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00e0ff, #9b4fff);
}

/* ===== Selection ===== */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: #fff;
}

/* ===== Media Queries ===== */
@media print {
    body::before {
        display: none;
    }
    #particles-canvas {
        display: none;
    }
}

@media screen and (max-width: 1024px) {
    .container {
        width: 95%;
        margin: 40px auto 20px;
    }
}

/* ===== Pulse animation for key elements ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== Fade in animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Tech corner accents ===== */
h2::before {
    content: '//';
    color: var(--primary-color);
    opacity: 0.5;
    font-size: 0.7em;
    margin-right: 6px;
    font-family: 'Orbitron', monospace;
    letter-spacing: 2px;
}

/* ===== Link highlight ===== */
a[href*="scholar"]:hover,
a[href*="ieee"]:hover,
a[href*="github"]:hover {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    padding: 2px 8px;
}

/* ===== Email highlight ===== */
a[href^="mailto:"] {
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

a[href^="mailto:"]:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(123, 47, 255, 0.6);
}

/* ===== Staff Shortcut Navigation Bar ===== */
class[class="staffshortcut"] {
    display: block;
    margin: 8px 0 2px 0;
}

class[class="staffshortcut"] a {
    display: inline-block;
    padding: 4px 12px;
    margin: 2px 3px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    color: var(--primary-color);
    text-decoration: none;
    background: rgba(0, 212, 255, 0.05);
}

class[class="staffshortcut"] a:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    color: #fff;
    text-shadow: 0 0 5px #fff;
    border-bottom: 1px solid var(--primary-color);
}

/* ===== Menu / Top Navigation Bar ===== */
.menu {
    background: linear-gradient(180deg, rgba(10, 10, 20, 0.95), rgba(10, 15, 30, 0.9)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.menu a {
    font-size: 110%;
    padding: 0.25ex 1.5ex;
    color: var(--text-primary) !important;
    text-decoration: none;
    transition: .3s;
}

.menu a:hover,
.menu a:active {
    color: var(--primary-color) !important;
    text-shadow: 0 0 10px var(--primary-glow);
    text-decoration: none;
}

/* ===== Publication text styles ===== */
p[style*="text-indent"] span {
    transition: all 0.3s ease;
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    line-height: 1.5;
}

p[style*="text-indent"] span:hover {
    background: rgba(0, 212, 255, 0.04);
}

p[style*="text-indent"] span b {
    color: #fff;
}

p[style*="text-indent"] span i {
    color: var(--primary-color);
}

/* ===== Code elements ===== */
tt, code {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 90%;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ===== Strong and emphasis ===== */
strong {
    color: #fff;
    font-weight: 700;
}

em {
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== Horizontal accent line ===== */
hr {
    border: none;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    margin: 20px 0;
}

/* ===== Image glow effects on photos ===== */
img[src*="photo"] {
    border-radius: 12px !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.25), 0 0 60px rgba(123, 47, 255, 0.15) !important;
    border: 2px solid rgba(0, 212, 255, 0.25) !important;
    transition: all 0.5s ease !important;
}

img[src*="photo"]:hover {
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.45), 0 0 80px rgba(123, 47, 255, 0.3) !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.05) !important;
}

/* ===== Data toggle collapse panels ===== */
.panel[data-toggle] {
    cursor: pointer;
}

/* ===== Bilibili iframe container ===== */
.panel-body iframe {
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

/* ===== Font icons ===== */
.fa {
    display: inline-block;
}
