/* ==========================================================================
   科技感终端风格打字机效果 (Tech Terminal Style) - Midnight Sapphire 版
   设计理念: 深邃空间感 + 电子荧光 + 呼吸动效
   ========================================================================== */

/* ===== Hello 手写动画 - CodePen 风格连笔书写 ===== */
.hello-animation {
    z-index: 1;
    margin-bottom: 28px;
    width: 100%;
    max-width: 540px;
    animation: float-in 0.6s ease-out;
}

#hello-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* 笔画基础样式 */
.hello-path {
    fill: none;
    stroke-width: 18px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 笔画 1：Hello 主体连笔 */
.hello-path-1 {
    stroke-dasharray: 1850 2000;
    stroke-dashoffset: 1851;
    transition: stroke-dashoffset 5s linear;
}

/* 笔画 2：o 的圆弧 */
.hello-path-2 {
    stroke-dasharray: 260 1000;
    stroke-dashoffset: 261;
    transition: stroke-dashoffset 1.2s linear 5.2s;
}

/* 笔画 3：! 的斜划 */
.hello-path-3 {
    stroke-dasharray: 100 1000;
    stroke-dashoffset: 101;
    transition: stroke-dashoffset 1s linear 6.5s;
}

/* 笔画 4：! 的圆点 */
.hello-path-4 {
    stroke-width: 0;
    transition: stroke-width 0.1s linear 7.5s;
}

/* 触发书写动画 */
#hello-container.fin .hello-path-1,
#hello-container.fin .hello-path-2,
#hello-container.fin .hello-path-3 {
    stroke-dashoffset: 0;
}

#hello-container.fin .hello-path-4 {
    stroke-width: 18px;
}







/* 移动端 Hello */
@media screen and (max-width: 768px) {
    .hello-animation {
        max-width: 340px;
        margin-bottom: 16px;
    }
}

/* ===== Hero Section 主容器 ===== */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0.4rem 2rem 2rem;
    overflow: hidden;
    width: min(100%, 1200px);
    margin-inline: auto;
    box-sizing: border-box;
}

/* 防止视口宽度导致水平滚动条 */
.md-content {
    overflow-x: clip;
}

/* 首页首屏收紧顶部留白 */
.md-content:has(.hero-section) {
    padding-top: 0 !important;
}

.md-content:has(.hero-section) .md-content__inner {
    margin-top: 0;
    padding-top: 0;
}

/* 网格背景装饰 - 更精致的点阵网格 */
.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle, rgba(0, 63, 136, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

@keyframes grid-drift {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

/* 渐变光晕效果 - 多层叠加 */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 620px;
    height: 620px;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 63, 136, 0.12) 0%,
        rgba(0, 80, 170, 0.06) 35%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 10s ease-in-out infinite;
}

/* 第二层光晕 - 偏移的暖色 */
.hero-glow::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -30%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        circle,
        rgba(245, 158, 11, 0.06) 0%,
        transparent 70%
    );
    animation: none;
}

@keyframes warm-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-30px, 20px); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.52; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.72; transform: translate(-50%, -50%) scale(1.03); }
}

/* 浮动粒子效果 */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 63, 136, 0.15);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-duration: 24s; animation-delay: 0s; width: 4px; height: 4px; background: rgba(0, 63, 136, 0.16); }
.particle:nth-child(2) { left: 25%; top: 70%; animation-duration: 20s; animation-delay: -3s; }
.particle:nth-child(3) { left: 45%; top: 30%; animation-duration: 26s; animation-delay: -6s; width: 2px; height: 2px; }
.particle:nth-child(4) { left: 60%; top: 80%; animation-duration: 22s; animation-delay: -2s; }
.particle:nth-child(n+5) { display: none; }

@keyframes float-particle {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(180deg); opacity: 0; }
}

/* ===== 终端窗口样式 - 蓝宝石光泽 ===== */
.typewriter-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    animation: float-in 0.8s ease-out;
}

@keyframes float-in {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.terminal-window {
    background: #012456;
    border-radius: 12px;
    box-shadow: 
        0 30px 60px -15px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 120, 212, 0.3),
        0 0 80px -20px rgba(0, 63, 136, 0.15);
    overflow: hidden;
    position: relative;
}

/* 终端顶部荧光线 */
.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
    z-index: 10;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(180deg, #01315e 0%, #012456 100%);
    border-bottom: 1px solid rgba(0, 120, 212, 0.3);
}

.terminal-icon {
    font-size: 1rem;
    margin-right: 8px;
}

.terminal-title {
    flex: 1;
    font-family: "Segoe UI", "JetBrains Mono", sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.terminal-controls {
    display: flex;
    gap: 2px;
}

.terminal-ctrl {
    width: 46px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-family: "Segoe UI", sans-serif;
    cursor: pointer;
    transition: background 0.15s;
}

.terminal-ctrl:hover {
    background: rgba(255, 255, 255, 0.1);
}

.terminal-ctrl.close:hover {
    background: #e81123;
}

.terminal-body {
    padding: 28px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    position: relative;
}

/* 终端扫描线效果 */
.terminal-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.terminal-line {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
}

.terminal-line:last-child {
    margin-bottom: 0;
}

.terminal-prompt {
    color: #27c93f;
    font-weight: 600;
    margin-right: 12px;
    font-size: 1.2rem;
    text-shadow: 0 0 12px rgba(39, 201, 63, 0.6), 0 0 4px rgba(39, 201, 63, 0.3);
}

/* ===== 打字机文字样式 ===== */
.typewriter-line-1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.4;
    color: #e0e0e0;
    min-height: 2.2rem;
    letter-spacing: 0.5px;
}

.typewriter-line-2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
    color: #64b5f6;
    min-height: 1.8rem;
    opacity: 0.9;
}

/* 光标样式 - 更强烈的荧光效果 */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: #27c93f;
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink-cursor 1s step-end infinite;
    box-shadow: 0 0 12px rgba(39, 201, 63, 0.9), 0 0 4px rgba(39, 201, 63, 0.6);
    border-radius: 1px;
}

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

.hidden-cursor {
    display: none;
    animation: none;
}

/* ===== 快捷入口按钮 - 玻璃态 + 渐变底光 ===== */
.hero-actions {
    display: flex;
    gap: 18px;
    margin-top: 44px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
    animation: float-in 0.8s ease-out 0.3s backwards;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    border-radius: 14px;
    text-decoration: none !important;
    font-family: "Inter", "Noto Sans SC", "Segoe UI", sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.action-btn .btn-text {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left 0.6s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #003F88 0%, #0060CC 50%, #0078D4 100%);
    color: #fff !important;
    box-shadow: 
        0 6px 20px rgba(0, 63, 136, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 14px 40px rgba(0, 63, 136, 0.5),
        0 0 25px rgba(0, 120, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.action-btn.secondary {
    background: rgba(0, 63, 136, 0.06);
    color: var(--md-primary-fg-color, #003F88) !important;
    border: 1.5px solid rgba(0, 63, 136, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.action-btn.secondary:hover {
    background: rgba(0, 63, 136, 0.14);
    transform: translateY(-3px);
    border-color: rgba(0, 63, 136, 0.45);
    box-shadow: 0 10px 30px rgba(0, 63, 136, 0.15);
}

.btn-icon {
    font-size: 1.2em;
}

.btn-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.action-btn:hover .btn-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===== 状态栏 - 胶囊式浮动 ===== */
.status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    padding: 14px 28px;
    width: fit-content;
    max-width: min(100%, 860px);
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(0, 63, 136, 0.04);
    border: 1px solid rgba(0, 63, 136, 0.08);
    border-radius: 50px;
    z-index: 1;
    animation: float-in 0.8s ease-out 0.5s backwards;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.online {
    background: #27c93f;
    box-shadow: 0 0 12px rgba(39, 201, 63, 0.7);
}

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

.status-icon {
    font-size: 1em;
}

.status-text {
    font-family: "Inter", "Noto Sans SC", "Segoe UI", sans-serif;
    font-size: 0.85rem;
    color: #666;
}

.status-divider {
    color: #ccc;
    font-size: 0.8rem;
}

/* ===== 移动端适配 ===== */
@media screen and (max-width: 768px) {
    .hero-section {
        min-height: 65vh;
        padding: 0.35rem 1.5rem 1.5rem;
    }
    
    .terminal-window {
        border-radius: 10px;
    }
    
    .terminal-body {
        padding: 16px;
    }
    
    .typewriter-line-1 { 
        font-size: 1.1rem; 
    }
    
    .typewriter-line-2 { 
        font-size: 0.9rem; 
    }
    
    .terminal-prompt {
        font-size: 1rem;
        margin-right: 8px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 11px 18px;
        font-size: 0.95rem;
    }
    
    .status-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 16px;
        gap: 10px;
        margin-top: 14px;
    }
    
    .hero-glow {
        width: 300px;
        height: 300px;
    }
}

/* ===== 暗色模式适配 - 深海蓝宝石风格 ===== */
[data-md-color-scheme="slate"] .hero-bg-grid {
    background-image: 
        radial-gradient(circle, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
    background-size: 30px 30px;
}

[data-md-color-scheme="slate"] .hero-glow {
    width: 680px;
    height: 680px;
    background: radial-gradient(
        ellipse at center,
        rgba(59, 130, 246, 0.18) 0%,
        rgba(99, 102, 241, 0.08) 25%,
        rgba(245, 158, 11, 0.04) 50%,
        transparent 75%
    );
    animation: glow-pulse-dark 12s ease-in-out infinite;
}

[data-md-color-scheme="slate"] .hero-glow::after {
    background: radial-gradient(
        circle,
        rgba(245, 158, 11, 0.08) 0%,
        transparent 70%
    );
}

@keyframes glow-pulse-dark {
    0%, 100% { 
        opacity: 0.4; 
        transform: translate(-50%, -50%) scale(1); 
    }
    33% { 
        opacity: 0.55; 
        transform: translate(-50%, -50%) scale(1.03);
    }
    66% { 
        opacity: 0.48; 
        transform: translate(-50%, -50%) scale(1.015);
    }
}

/* 暗色模式粒子 */
[data-md-color-scheme="slate"] .particle {
    background: rgba(59, 130, 246, 0.2);
}
[data-md-color-scheme="slate"] .particle:nth-child(1),
[data-md-color-scheme="slate"] .particle:nth-child(5) {
    background: rgba(245, 158, 11, 0.15);
}

[data-md-color-scheme="slate"] .terminal-window {
    background: linear-gradient(145deg, #0b1120 0%, #131c31 100%);
    box-shadow: 
        0 30px 70px -15px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(59, 130, 246, 0.2),
        0 0 60px rgba(59, 130, 246, 0.08);
}

[data-md-color-scheme="slate"] .terminal-window::before {
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

[data-md-color-scheme="slate"] .terminal-header {
    background: linear-gradient(90deg, #131c31 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

[data-md-color-scheme="slate"] .terminal-title {
    color: #94a3b8;
}

[data-md-color-scheme="slate"] .terminal-body {
    background: #0b1120;
}

[data-md-color-scheme="slate"] .terminal-body::after {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.05) 2px,
        rgba(0, 0, 0, 0.05) 4px
    );
}

[data-md-color-scheme="slate"] .terminal-prompt {
    color: #3b82f6;
    text-shadow: 0 0 14px rgba(59, 130, 246, 0.7), 0 0 6px rgba(59, 130, 246, 0.4);
}

[data-md-color-scheme="slate"] .typewriter-line-1 {
    color: #f1f5f9;
    text-shadow: 0 0 20px rgba(241, 245, 249, 0.08);
}

[data-md-color-scheme="slate"] .typewriter-line-2 {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

[data-md-color-scheme="slate"] .typing-cursor {
    background-color: #3b82f6;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.9), 0 0 6px rgba(59, 130, 246, 0.5);
}

/* 按钮暗色模式 - 蓝宝石主题 */
[data-md-color-scheme="slate"] .action-btn.primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #fff !important;
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.35);
}

[data-md-color-scheme="slate"] .action-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    box-shadow: 
        0 12px 40px rgba(37, 99, 235, 0.45),
        0 0 25px rgba(59, 130, 246, 0.2);
}

[data-md-color-scheme="slate"] .action-btn.secondary {
    background: rgba(59, 130, 246, 0.08);
    color: #93c5fd !important;
    border: 1.5px solid rgba(59, 130, 246, 0.25);
}

[data-md-color-scheme="slate"] .action-btn.secondary:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        0 10px 35px rgba(59, 130, 246, 0.2),
        0 0 20px rgba(59, 130, 246, 0.1);
}

/* 状态栏暗色模式 */
[data-md-color-scheme="slate"] .status-bar {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

[data-md-color-scheme="slate"] .status-dot.online {
    background: #3b82f6;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.8);
}

[data-md-color-scheme="slate"] .status-text {
    color: #94a3b8;
}

[data-md-color-scheme="slate"] .status-divider {
    color: #30363d;
}