/* ==================== 字体定义 ==================== */
@font-face {
    font-family: 'AlimamaDaoLiTi';
    src: url('../fonts/AlimamaDaoLiTi-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==================== 全局变量 ==================== */
:root {
    --primary-color: #ffffff;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-color: #4a89dc;
    --bg-dark: #121212;
    
    /* Glassmorphism 变量 */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    --glass-blur: blur(12px);
    
    --card-radius: 16px;
    --transition-speed: 0.3s;
    
    --font-main: 'AlimamaDaoLiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==================== 基础重置 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* 背景图由JS动态加载 */
    background: linear-gradient(135deg, #1e2024 0%, #23272e 100%);
    background-attachment: fixed;
    cursor: url('../img/mouse.png'), auto;
    position: relative;
}

/* 背景遮罩 - 增强对比度 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* 默认轻微遮罩 */
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

/* ==================== 加载动画 ==================== */
#global-loading {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: #121212;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}

#global-loading.hide {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1rem;
    letter-spacing: 2px;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 布局容器 ==================== */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* ==================== 通用组件 ==================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.2);
}

.section-header {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

/* ==================== 个人简介卡片 ==================== */
.profile-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-header {
    margin-bottom: 1.5rem;
}

.logo-container {
    position: relative;
    margin-bottom: 1rem;
    display: inline-block;
}

.profile-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-logo:hover {
    transform: rotate(360deg);
}

.profile-name {
    font-size: 2rem;
    margin: 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.hitokoto-container {
    margin: 1rem 0 2rem;
    max-width: 600px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-height: 1.8em;
}

.social-links-row {
    display: flex;
    gap: 1.5rem;
}

.social-links-row a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    transition: all 0.3s;
}

.social-links-row a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    color: #fff;
}

/* ==================== 导航网格 ==================== */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.nav-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nav-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    transition: transform 0.3s;
}

.nav-card:hover .nav-icon {
    transform: scale(1.1);
}

.nav-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.nav-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.external-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ==================== 最近更新 ==================== */
.more-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.more-link:hover {
    color: var(--accent-color);
}

.updates-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.update-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    transition: background 0.3s;
}

.update-item:hover {
    background: rgba(0, 0, 0, 0.4);
}

.update-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.update-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-category {
    background: rgba(74, 137, 220, 0.2);
    color: #64b5f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ==================== 全屏覆盖层 (页面) ==================== */
.fullscreen-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.fullscreen-section:target {
    opacity: 1;
    visibility: visible;
}

.section-container {
    max-width: 900px;
    margin: 0 auto;
    background: #1e1e1e;
    background: rgba(30, 30, 30, 0.95);
    border-radius: var(--card-radius);
    padding: 2rem;
    min-height: 80vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.fullscreen-section:target .section-container {
    transform: translateY(0);
}

.section-header-sticky {
    position: sticky;
    top: -2rem;
    background: rgba(30, 30, 30, 0.98);
    padding: 1rem 0;
    margin-top: -1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 关于页面内容 */
.about-content-wrapper {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.about-avatar-large img {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.about-details h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.bio-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.about-details h4 {
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 0.8rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s;
}

.skill-tag:hover {
    background: var(--accent-color);
}

.interests {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
}

/* 友链页面 */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.friend-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.friend-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.friend-card img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
}

.friend-info {
    flex: 1;
    overflow: hidden;
}

.friend-name {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.friend-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 个人导航页面 */
.nav-categories-grid {
    display: grid;
    gap: 2rem;
}

.nav-category-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
}

.nav-category-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.nav-links-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.nav-link-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link-row:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link-row img, .nav-emoji {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links {
    margin: 0.5rem 0;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.police-beian {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.police-beian img {
    height: 16px;
}

/* 友链提交表单样式 */
.friend-submit-wrapper {
    margin-top: 2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}

.friend-submit-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
}

.friend-submit-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    outline: none;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--accent-color);
}

.radio-group {
    flex-direction: row;
    gap: 1.5rem;
}

.submit-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent-color);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #357abd;
}

/* ==================== 移动端适配优化 (重要) ==================== */
@media (max-width: 768px) {
    /* 1. 增强背景遮罩，提高可读性 */
    body::before {
        background: rgba(0, 0, 0, 0.5);
    }

    /* 2. 容器调整 */
    .main-container {
        padding: 1rem;
        gap: 1.5rem;
    }

    /* 3. 卡片背景加深，减少透明度，防止文字看不清 */
    .glass-card {
        background: rgba(30, 30, 30, 0.85); /* 几乎不透明 */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 1.2rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* 4. 个人信息卡片优化 */
    .profile-logo {
        width: 100px;
        height: 100px;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .hitokoto-container {
        font-size: 1rem;
        margin: 0.5rem 0 1.5rem;
    }

    /* 5. 导航网格调整 - 保持两列，但减小间距 */
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .nav-card {
        padding: 0.8rem;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }

    /* 6. 最近更新调整 - 单列 */
    .updates-list {
        grid-template-columns: 1fr;
    }

    /* 7. 全屏页面优化 - 确保背景不透明，防止重叠 */
    .fullscreen-section {
        background: #121212; /* 纯色背景，不再透明 */
        padding: 0;
        z-index: 9999;
    }

    .section-container {
        background: transparent;
        box-shadow: none;
        border: none;
        border-radius: 0;
        min-height: 100vh;
        padding: 1rem;
    }

    .section-header-sticky {
        top: 0;
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
        background: #181818;
        border-bottom: 1px solid #333;
    }

    /* 关于页面移动端 */
    .about-content-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .about-avatar-large img {
        width: 120px;
        height: 120px;
    }

    .about-details h4 {
        border-left: none;
        border-bottom: 2px solid var(--accent-color);
        display: inline-block;
        padding: 0 1rem 0.5rem;
    }

    .skill-tags, .interests {
        justify-content: center;
    }
    
    /* 页脚优化 */
    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .separator {
        display: none; /* 移动端隐藏分隔符，让链接自然换行 */
    }
}

/* 移动端菜单按钮 (保持隐藏，因为使用网格导航) */
.mobile-menu-toggle {
    display: none;
}
