/* ========= 基础排版 ========= */
:root {
    --main-color: #2240d3;
    --bg-color: #82edd8;
    --code-green: #00ff00;
    --code-blue: #4da6ff;
    --code-purple: #cc66ff;
    --code-yellow: #ffcc00;
    --radius: 12px;
    --dark-bg: #0a0e17;
}

body {
    background: var(--dark-bg);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ========= 背景元素 ========= */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.8;
}

/* 代码网格背景 */
.code-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(20, 120, 200, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 120, 200, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: top center;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* 浮动代码片段 */
.floating-code {
    position: absolute;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.6;
    text-shadow: 0 0 5px currentColor;
    animation: float 20s infinite linear;
}

.code-1 { color: var(--code-green); top: 10%; left: 5%; animation-delay: 0s; }
.code-2 { color: var(--code-blue); top: 20%; right: 10%; animation-delay: -5s; }
.code-3 { color: var(--code-purple); bottom: 30%; left: 15%; animation-delay: -10s; }
.code-4 { color: var(--code-yellow); bottom: 15%; right: 20%; animation-delay: -15s; }
.code-5 { color: #ff3366; top: 40%; left: 30%; animation-delay: -2s; }
.code-6 { color: #00ccff; bottom: 40%; right: 30%; animation-delay: -8s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    25% { transform: translateY(-20px) translateX(10px) rotate(5deg); }
    50% { transform: translateY(10px) translateX(-10px) rotate(-5deg); }
    75% { transform: translateY(-10px) translateX(-5px) rotate(3deg); }
}

/* 二进制雨效果 */
.binary-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.binary-digit {
    position: absolute;
    color: var(--code-green);
    font-size: 18px;
    opacity: 0;
    animation: rainFall 8s linear infinite;
}

@keyframes rainFall {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ========= 顶部个人卡片 ========= */
.dtu-profile-card {
    background: rgba(15, 25, 45, 0.85);
    border-radius: var(--radius);
    padding: 40px;
    margin: 40px auto 60px;
    max-width: 800px;
    text-align: center;
    border: 1px solid rgba(100, 150, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0, 50, 150, 0.2);
    position: relative;
    z-index: 2;
}

.dtu-avatar-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 25px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--code-blue);
    box-shadow: 0 0 20px rgba(77, 166, 255, 0.5);
}

.dtu-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dtu-title {
    color: white;
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(34, 64, 211, 0.7);
}

.dtu-name-highlight {
    color: var(--code-green);
    position: relative;
}

.dtu-name-highlight::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--code-green);
    border-radius: 2px;
}












.dtu-subtitle {
    color: var(--code-blue);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.dtu-description {
    color: #ccc;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 25px;
}

.dtu-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.dtu-tag {
    background: rgba(77, 166, 255, 0.15);
    color: var(--code-blue);
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid rgba(77, 166, 255, 0.3);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.dtu-tag:hover {
    background: rgba(77, 166, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(77, 166, 255, 0.2);
}

/* ========= 内容区域 ========= */
.content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* 代码卡片 */
.card {
    background: rgba(15, 25, 45, 0.7);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(100, 150, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 100, 255, 0.3);
    border-color: rgba(100, 150, 255, 0.4);
}

.card-title {
    color: var(--code-blue);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.card-title::before {
    content: "> ";
    color: var(--code-green);
    margin-right: 8px;
}

/* 代码片段样式 */
.code-snippet {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid var(--main-color);
}

.code-snippet code {
    display: block;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

.keyword { color: var(--code-blue); }
.function { color: var(--code-yellow); }
.string { color: var(--code-green); }
.comment { color: #888; }
.variable { color: var(--code-purple); }
.number { color: #ff6666; }

/* 终端样式区域 */
.terminal {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #333;
    padding: 12px 20px;
    display: flex;
    align-items: center;
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27ca3f; }

.terminal-body {
    padding: 20px;
    min-height: 120px;
}

.terminal-line {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.terminal-prompt {
    color: var(--code-green);
    margin-right: 10px;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--code-green);
    margin-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 技能部分 */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.skill-category {
    background: rgba(20, 30, 50, 0.7);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--code-purple);
}

.skill-category h3 {
    color: var(--code-purple);
    margin-top: 0;
}

.skill-item {
    margin-bottom: 15px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--code-blue), var(--code-green));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .dtu-profile-card {
        padding: 30px 20px;
        margin: 20px 15px 40px;
    }

    .dtu-title {
        font-size: 2.2rem;
    }

    .dtu-avatar-wrapper {
        width: 120px;
        height: 120px;
    }

    .floating-code {
        font-size: 12px;
    }

    .content {
        padding: 0 15px 40px;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--main-color);
    border-radius: 5px;
}





/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
}





/*返回按钮*/
.sp-back-btn {
  /* 固定到右下角 */
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;          /* 保证在最上层 */

  /* 原按钮样式 */
  background: #fbca1f;
  font-family: inherit;
  padding: 0.6em 1.3em;
  font-weight: 900;
  font-size: 18px;
  color: #000;            /* 明确文字颜色 */
  border: 3px solid #000;
  border-radius: 0.4em;
  box-shadow: 0.1em 0.1em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.sp-back-btn:hover {
  transform: translate(-0.05em, -0.05em);
  box-shadow: 0.15em 0.15em;
}

.sp-back-btn:active {
    transform: translate(0.05em, 0.05em);
    box-shadow: 0.05em 0.05em;
}