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

:root {
    --primary-color: #165DFF;
    --primary-light: #E8F3FF;
    --primary-dark: #0E42D2;
    --secondary-color: #36CFC9;
    --text-dark: #1D2129;
    --text-gray: #4E5969;
    --text-light: #86909C;
    --bg-light: #F7F8FA;
    --border-light: #E5E6EB;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    background-color: var(--bg-light);
    color: var(--text-dark);
    padding-top: 56px;
    margin: 0;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(22, 93, 255, 0.15);
    transition: var(--transition);
    padding: 0.8rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar-brand {
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

/* 侧边栏样式 */
.left-sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    height: calc(100vh - 56px);
    width: 220px;
    padding-top: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 900;
}

.left-sidebar.show {
    transform: translateX(0);
}

/* 文章卡片样式 */
.article-card {
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* 页脚样式 */
.footer-section {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid var(--border-light);
    background-color: #fff;
    text-align: center;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    margin: 0 8px;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 404页面样式 */
.error-container {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin: 2rem auto;
    max-width: 600px;
}

.error-icon {
    font-size: 8rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.error-icon.small {
    font-size: 4rem;
    color: #ff4d4f;
    margin-bottom: 1.5rem;
}

/* 关于页面样式 */
.about-header {
    background: linear-gradient(135deg, #f8f9fa 0%, var(--primary-light) 100%);
    padding: 4rem 0 3rem;
    margin-bottom: 3rem;
    position: relative;
}

.skill-bar {
    height: 10px;
    background-color: #f1f3f5;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 5px;
    transition: width 1.2s ease-in-out;
    width: 0;
}

/* 响应式样式 */
@media (max-width: 1200px) {
    .left-sidebar {
        width: 180px;
    }
    .main-container {
        margin-left: 180px;
    }
}

@media (max-width: 992px) {
    .left-sidebar {
        transform: translateX(-100%);
        top: 56px;
        height: calc(100vh - 56px);
    }
    .main-container {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .article-card .card-title {
        font-size: 1.25rem;
    }
    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 15px;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        margin-top: 10px;
    }
}

/* 动画定义 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* 按钮点击波纹效果 */
.btn {
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:active::after {
    width: 300px;
    height: 300px;
}

/* 优化卡片阴影 */
.article-card, .sidebar-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.article-card:hover, .sidebar-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
