/* ============================================
   蔡万铖个人简介 - 科幻风格主题
   ============================================ */

/* CSS 变量 */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.8);
    --bg-card-hover: rgba(24, 24, 36, 0.9);

    --cyan: #00f0ff;
    --cyan-dim: rgba(0, 240, 255, 0.3);
    --cyan-glow: rgba(0, 240, 255, 0.5);
    --magenta: #ff00ff;
    --magenta-dim: rgba(255, 0, 255, 0.3);
    --yellow: #f0ff00;
    --green: #00ff88;
    --red: #ff3366;

    --text-primary: #e0e0e8;
    --text-secondary: #8888aa;
    --text-muted: #555577;

    --border-color: rgba(0, 240, 255, 0.2);
    --border-glow: rgba(0, 240, 255, 0.5);

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', 'Noto Sans SC', sans-serif;
    --font-mono: 'Courier New', monospace;
}

/* 重置 & 基础 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* 扫描线效果 */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

/* 网格背景 */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* 粒子画布 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* 主容器 */
.container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ============================================
   导航栏
   ============================================ */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.logo-bracket {
    color: var(--cyan);
}

.logo-text {
    color: var(--text-primary);
    margin: 0 5px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--cyan-glow);
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--green);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
}

/* ============================================
   Section 通用样式
   ============================================ */
.section {
    min-height: 100vh;
    padding: 120px 0 80px;
    position: relative;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.section-index {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--cyan);
    opacity: 0.6;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

/* ============================================
   Hero 区域
   ============================================ */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 100vh;
    padding-top: 80px;
}

.hero-content {
    position: relative;
}

.hero-glitch-container {
    position: relative;
    margin-bottom: 30px;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: 10px;
    color: var(--text-primary);
    position: relative;
    text-shadow:
        0 0 20px rgba(0, 240, 255, 0.5),
        0 0 40px rgba(0, 240, 255, 0.3),
        0 0 80px rgba(0, 240, 255, 0.2);
    animation: glitch 3s infinite;
}

.hero-name::before,
.hero-name::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-name::before {
    color: var(--cyan);
    z-index: -1;
    animation: glitch-1 2s infinite;
}

.hero-name::after {
    color: var(--magenta);
    z-index: -2;
    animation: glitch-2 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, 2px); }
    92% { transform: translate(2px, -2px); }
    93% { transform: translate(-2px, -2px); }
    94% { transform: translate(2px, 2px); }
}

@keyframes glitch-1 {
    0%, 90%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); }
    91% { transform: translate(3px, -3px); clip-path: inset(20% 0 40% 0); }
    93% { transform: translate(-3px, 3px); clip-path: inset(60% 0 10% 0); }
}

@keyframes glitch-2 {
    0%, 90%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); }
    92% { transform: translate(-3px, 3px); clip-path: inset(40% 0 20% 0); }
    94% { transform: translate(3px, -3px); clip-path: inset(10% 0 60% 0); }
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--cyan);
    letter-spacing: 6px;
    margin-bottom: 40px;
    min-height: 30px;
}

.typing-text {
    border-right: 2px solid var(--cyan);
    padding-right: 5px;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-tagline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tag-separator {
    color: var(--cyan);
    opacity: 0.5;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary {
    background: transparent;
    color: var(--cyan);
    border: 2px solid var(--cyan);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--cyan-dim);
    box-shadow: 0 0 30px var(--cyan-glow), inset 0 0 30px var(--cyan-dim);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-top: 80px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-glow);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* ============================================
   关于我
   ============================================ */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.avatar-frame {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

.avatar-placeholder {
    width: 200px;
    height: 200px;
    margin: 25px auto;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 2px solid var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.avatar-text {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-glow);
}

.avatar-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    opacity: 0.3;
    animation: ring-rotate 10s linear infinite;
}

@keyframes ring-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.avatar-dots {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px dashed var(--cyan);
    border-radius: 50%;
    opacity: 0.2;
    animation: ring-rotate 15s linear infinite reverse;
}

.avatar-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--green);
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px;
    margin-bottom: 30px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--cyan);
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.info-icon {
    color: var(--cyan);
    animation: rotate-slow 4s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.status-active {
    color: var(--green);
}

.about-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-description p {
    margin-bottom: 15px;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--cyan);
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-dim);
}

/* ============================================
   技能树
   ============================================ */
.skills-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 30px var(--cyan-dim);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.category-icon {
    color: var(--cyan);
    font-size: 1.2rem;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s ease;
}

.skill-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.skill-percent {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--cyan);
}

.skill-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    border-radius: 3px;
    width: 0;
    transition: width 1s ease;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

/* ============================================
   项目经历
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 35px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--cyan);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.1);
    transform: translateY(-5px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-index {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--cyan);
    opacity: 0.6;
}

.project-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tech span {
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan);
}

.project-link {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--cyan);
}

/* ============================================
   联系方式
   ============================================ */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-intro {
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.contact-channels {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.channel-item:hover {
    border-color: var(--cyan);
    background: var(--bg-card-hover);
}

.channel-icon {
    font-size: 1.5rem;
}

.channel-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.channel-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.channel-value {
    color: var(--cyan);
    font-size: 1rem;
}

.channel-value:hover {
    text-shadow: 0 0 10px var(--cyan-glow);
}

/* 表单样式 */
.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.label-index {
    color: var(--cyan);
    opacity: 0.6;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-dim);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    background: var(--cyan-dim);
    box-shadow: 0 0 30px var(--cyan-glow), inset 0 0 30px var(--cyan-dim);
}

.btn-icon {
    animation: rotate-slow 4s linear infinite;
}

/* ============================================
   页脚
   ============================================ */
.footer {
    padding: 40px 0;
    margin-top: 100px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--cyan);
    letter-spacing: 3px;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-quote {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* ============================================
   动画 & 特效
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 能量波动效果 */
@keyframes energy-wave {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* 悬浮效果 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1200px) {
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }

    .nav-bar {
        padding: 15px 20px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .avatar-frame {
        width: 200px;
        height: 200px;
    }

    .avatar-placeholder {
        width: 160px;
        height: 160px;
    }

    .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    }


    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-name {
        font-size: clamp(2rem, 6vw, 4rem);
        letter-spacing: 5px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-tagline {
        flex-direction: column;
        gap: 10px;
    }

    .tag-separator {
        display: none;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyan);
}

/* ============================================
   选择文本样式
   ============================================ */
::selection {
    background: var(--cyan-dim);
    color: var(--cyan);
}
