:root {
    --primary-bg: #0B1219;
    --primary-text: #e2e8f0;
    --accent: #38bdf8;
    --card-bg: rgba(30, 41, 59, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Noto Sans SC', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--accent);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.section {
    min-height: 100vh;
    padding: 8rem 5% 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero {
    text-align: center;
    position: relative;
}

.avatar-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
    position: relative;
    z-index: 2;
}

.avatar-halo {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    animation: pulse 3s infinite ease-in-out;
    z-index: 1;
}

.avatar-halo:nth-child(2) {
    animation-delay: 0.5s;
}

.avatar-halo:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.greeting {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.name {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

.name::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.quote-source {
    font-style: italic;
    text-align: center;
    margin-top: 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    font-size: 0.9em;
}

.typing-quote {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.6;
    min-height: 100px;
    color: rgba(255, 255, 255);
    padding: 1rem 1rem;
    background: transparent;
    border-radius: 0 8px 8px 0;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.3rem;
    background-color: var(--accent);
    margin-left: 5px;
    animation: blink 1s infinite;
}

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

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.github-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.github-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.project-body {
    padding: 1.5rem;
}

.project-description {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.tag {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.contact-container {
    width: 100%;
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
    justify-items: center; /* 水平居中每个卡片 */
    justify-content: center; /* 整个网格容器居中 */
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--accent);
}

.language-selector{
    position: fixed;
    bottom: 3rem;
    right: 2rem;
    margin-right: 40px;
    margin-top: 40px;
    z-index: 1000;
    width: 120px;
    height: 120px;
    perspective: 1000px;
}

.language-selector, .language-selector * {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-15deg) rotateY(-45deg);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid var(--accent);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    transition: all 0.3s;
}

.cube-face:hover {
    background: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.cube-face.active {
    background: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
}

/* 立方体各面位置 - 修复错位问题 */
.cube-face:nth-child(1) { transform: translateZ(60px); } /* 前面 */
.cube-face:nth-child(2) { transform: rotateY(180deg) translateZ(60px); } /* 后面 */
.cube-face:nth-child(3) { transform: rotateY(-90deg) translateZ(60px); } /* 左面 */
.cube-face:nth-child(4) { transform: rotateY(90deg) translateZ(60px); } /* 右面 */
.cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(60px); background: rgba(56, 189, 248, 0.3); } /* 上盖 */
.cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(60px); background: rgba(56, 189, 248, 0.3); } /* 下盖 */

.language-info {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s, top 0.3s;
    pointer-events: none;
    font-size: 0.9rem;
    border: 1px solid var(--accent);
}

.cube-face:hover .language-info {
    opacity: 1;
    top: -35px;
}

.language-icon {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.3);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--accent);
    z-index: 1001;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.floating-icons {
    position: absolute;
    z-index: -1;
    color: rgba(56, 189, 248, 0.2);
    animation: floating 6s infinite ease-in-out;
    font-size: 3rem;
}

@media (max-width: 992px) {
    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .name {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.5);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.5s ease;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-links a {
        padding: 1rem 0;
        width: 100%;
        text-align: center;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .quote-container {
        max-width: 95%;
    }
    
    .language-selector {
        bottom: 2rem;
        right: 1rem;
        width: 100px;
        height: 100px;
    }
    
    .cube-face {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }
    
    .typing-quote {
        font-size: 1.1rem;
        min-height: 85px;
    }
    
    .language-selector {
        width: 90px;
        height: 90px;
    }
    
    .cube-face {
        font-size: 0.9rem;
    }
}

.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.contact-card {
    text-decoration: none;
    color: inherit;
}

/* GitHub风格按钮 */
.github-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 30px;
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
}

.github-btn i {
    margin-right: 6px;
    font-size: 16px;
}

.github-btn {
    color: #c9d1d9;
    background-color: #21262d;
    border-color: rgba(240, 246, 252, 0.1);
}

.github-btn:hover {
    background-color: #30363d;
    border-color: #8b949e;
}

.github-btn:active {
    background-color: #292e36;
}


/* 友情链接页面 */
#friends {
    padding: 100px 5% 50px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--light-color);
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.friends-container {
    max-width: 1200px;
    width: 100%;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.friend-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.friend-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.friend-header {
    padding: 1.5rem;
    background: var(--dark-color);
    color: var(--light-color);
}

.friend-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-title i {
    color: var(--secondary-color);
}

.friend-url {
    color: #bbb;
    font-size: 0.9rem;
    word-break: break-all;
}

.friend-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.friend-description {
    color: #E2E8F0;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.friend-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.friend-tag {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.friend-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
    width: 100%;
    border: 2px solid var(--primary-color);
}

.friend-link:hover {
    background: transparent;
    color: var(--primary-color);
}

.friend-link i {
    margin-left: 5px;
}

/* 页脚 */
footer {
    background: rgba(0, 0, 0, 0.7);
    color: var(--light-color);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(44, 62, 80, 0.95);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: var(--transition);
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-links a {
        padding: 0.8rem;
    }
    
    #friends {
        padding-top: 80px;
    }
}

@media (max-width: 480px) {
    .friends-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

#home {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: url('../img/milky-way-2695569.jpg') !important;
  background-size: cover;
  background-repeat: repeat-x; /* 水平方向重复 */
  background-position: 0 0;
  color: #ffffff;
  overflow: hidden;
  animation: scrollBackground 220s linear infinite; /* 动画参数 */
}

@keyframes scrollBackground {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1000% 0;
  }
}

/* 隐藏所有纵向滚动条 */
::-webkit-scrollbar {
  width: 0 !important;
  background: transparent;
}
html, body, .main-scroll, .unified-sidebar {
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}
