/* 全局样式 */
body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    overflow-x: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.grid-bg {
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.content-layer {
    position: relative;
    z-index: 1;
}

/* Glitch特效 */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    20% { clip: rect(54px, 9999px, 96px, 0); }
    40% { clip: rect(70px, 9999px, 99px, 0); }
    60% { clip: rect(3px, 9999px, 63px, 0); }
    80% { clip: rect(37px, 9999px, 95px, 0); }
    100% { clip: rect(68px, 9999px, 39px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 99px, 0); }
    20% { clip: rect(93px, 9999px, 4px, 0); }
    40% { clip: rect(26px, 9999px, 99px, 0); }
    60% { clip: rect(11px, 9999px, 48px, 0); }
    80% { clip: rect(85px, 9999px, 94px, 0); }
    100% { clip: rect(44px, 9999px, 14px, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

/* 霓虹边框 */
.neon-border {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), inset 0 0 20px rgba(99, 102, 241, 0.1);
}

/* 光标闪烁 */
.terminal-cursor::after {
    content: '█';
    animation: blink 1s infinite;
    color: #6366f1;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 技能卡片 */
.skill-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-card:hover {
    border-color: #6366f1;
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

/* 矩阵雨 */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    z-index: 0;
}

/* 文档内容样式 */
.doc-content {
    max-width: 80rem;
    margin: 0 auto;
}

.doc-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.doc-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #a855f7;
    border-left: 4px solid #6366f1;
    padding-left: 1rem;
}

.doc-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #818cf8;
}

.doc-content p {
    line-height: 1.75;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.doc-content ul {
    list-style: none;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.doc-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.doc-content ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: #6366f1;
}

.doc-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    counter-reset: item;
}

.doc-content ol li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    counter-increment: item;
    line-height: 1.6;
}

.doc-content ol li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.doc-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.doc-content th {
    background: rgba(99, 102, 241, 0.2);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.doc-content td {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-content tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.doc-content code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #a5b4fc;
}

.doc-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.doc-content pre code {
    background: none;
    padding: 0;
    color: #22c55e;
}

.doc-content blockquote {
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0 0.5rem 0.5rem 0;
}

.doc-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    margin: 2rem 0;
}

.toc-link {
    color: #a855f7;
    text-decoration: none;
    transition: color 0.2s;
}

.toc-link:hover {
    color: #c084fc;
}

/* 返回按钮 */
.back-btn {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 100;
    background: rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    transform: translateX(-5px);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* 路径混淆特效 */
.obfuscated-path {
    display: inline-block;
    transition: all 0.5s ease;
}

.obfuscated-path:hover {
    animation: scramble 0.3s ease infinite;
}

@keyframes scramble {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-1deg); }
    75% { transform: scale(1.05) rotate(1deg); }
}