/* ========================================
   外部库样式重置
   ======================================== */
a,
area,
button,
input,
label,
select,
summary,
textarea,
[tabindex] {
    -ms-touch-action: manipulation;
    touch-action: manipulation;
}

.screenity-shadow-dom .TooltipContent,
.screenity-shadow-dom .TooltipContent * {
    -webkit-user-select: none;
    user-select: none;
}

/* ========================================
   全局样式重置和基础设置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

/* ========================================
   页面背景设置
   ======================================== */
.page {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#page-1 {
    background-image: url('../image/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#page-2 {
    background-image: url('../image/background-page-2.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ========================================
   页面区域样式
   ======================================== */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.content-wrapper {
    text-align: center;
    max-width: 800px;
}

.content-wrapper h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.3);
}

.content-wrapper p {
    font-size: 1.2rem;
    color: #cccccc;
    line-height: 1.6;
}

/* ========================================
   顶部标题区域样式 - 打字机效果
   ======================================== */
.header {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 3;
    padding: 0;
    height: auto;
}

.typewriter-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
}

.dialog-box {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(26, 26, 26, 0.9);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    position: relative;
    min-width: 200px;
    text-align: center;
    margin-top: 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.dialog-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #333;
}

#typewriter-text {
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    display: inline-block;
    height: 1.2em;
    line-height: 1.2em;
    vertical-align: bottom;
}

.cursor {
    font-size: 18px;
    color: #ffffff;
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: bottom;
}

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

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   右上角社交媒体图标导航
   ======================================== */
.social-nav {
    position: fixed;
    top: 30px;
    right: 40px;
    display: flex;
    gap: 20px;
    z-index: 3;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background-color: rgba(26, 26, 26, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid #333;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    background-color: #333;
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.social-icon {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

/* 悬停效果 */
#github-link:hover {
    color: #f0f6fc;
    background-color: #21262d;
}

#bilibili-link:hover {
    color: #00a1d6;
    background-color: #1a1a1a;
}

#mbti-link:hover {
    color: #0084ff;
    background-color: #1a1a1a;
}

/* ========================================
   项目链接下拉菜单
   ======================================== */
.link-dropdown {
    position: relative;
}

.link-dropdown .social-link {
    cursor: pointer;
    font-family: inherit;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    transform: translateY(8px);
    opacity: 0;
    visibility: hidden;
    min-width: 120px;
    background-color: rgba(26, 26, 26, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 2px solid #333;
    border-radius: 12px;
    padding: 6px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 8px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
/* 移动端基础布局调整 */
@media screen and (max-width: 540px) {
    .header {
        top: 1.25rem;
        left: 1.25rem;
    }
    
    .social-nav {
        top: 1.25rem;
        right: 1.25rem;
        gap: 0.9375rem;
    }
    
    .social-link {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .social-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .dialog-box {
        height: 2.5rem;
        min-width: 10rem;
        padding: 0.625rem 1rem;
        margin-top: 0;
    }
    
    #typewriter-text,
    .cursor {
        font-size: 1rem;
    }
    
    .content-wrapper h1 {
        font-size: 2rem;
    }
    
    .content-wrapper p {
        font-size: 1rem;
    }
}