/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* 颜色变量 */
:root {
    --primary: #ff6b35; /* 主色调：橙红色 */
    --secondary: #28a745; /* 辅助色：绿色 */
    --accent: #ff6b35; /* 强调色：橙红色 */
    --background: #ffffff; /* 背景色：白色 */
    --foreground: #333333; /* 前景色：深灰色 */
    --muted: #999999; /* 静音色：浅灰色 */
    --muted-foreground: #666666; /* 静音前景色：中灰色 */
    --card: #ffffff; /* 卡片背景 */
    --card-foreground: #333333; /* 卡片前景色 */
    --border: #e0e0e0; /* 边框色 */
    --input: #f8f9fa; /* 输入框背景 */
    --ring: #ff6b35; /* 焦点环颜色 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.navbar-logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.navbar-menu li a {
    text-decoration: none;
    color: var(--foreground);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.navbar-menu li a:hover {
    color: var(--primary);
}

.navbar-menu li a.active {
    color: var(--primary);
}

.navbar-menu li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

/* 响应式导航 */
.navbar-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: #ffffff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-toggle {
        display: block;
    }
}

/* 按钮样式 - 悬浮式卡片设计 */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.3s ease;
}

.btn:hover::before {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #e55a2b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    transform: translateY(0);
    will-change: transform;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e55a2b 0%, var(--primary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    will-change: transform;
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, #e55a2b 100%);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.25);
}

.btn-outline:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #218838 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
    transform: translateY(0);
    will-change: transform;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #218838 0%, var(--secondary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
}

.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

/* 实验室卡片悬浮效果 */
.lab-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.lab-card:hover .lab-image {
    transform: scale(1.03);
}

.lab-card .lab-image {
    transition: transform 0.3s ease;
}

/* 文章卡片悬浮效果 */
.article-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.article-card:hover .article-image {
    transform: scale(1.03);
}

.article-card .article-image {
    transition: transform 0.3s ease;
}

/* 导航链接悬浮效果 */
.nav-link {
    transition: color 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.25s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

/* 特色功能卡片悬浮效果 */
.feature-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 技术栈标签悬浮效果 */
.tech-tag {
    transition: transform 0.2s ease;
    cursor: default;
}

.tech-tag:hover {
    transform: translateY(-2px);
}

/* 卡片样式 */
.card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid #e5e7eb;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* 页脚样式 */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section ul li a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* 通用样式 */
.section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* 个人信息样式 */
.profile-section {
    background-color: var(--primary);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    margin: 0 auto 1.5rem;
    object-fit: cover;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.profile-title {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* 项目卡片样式 */
.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card .project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111827;
}

.project-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    color: #333;
}

.project-card .btn {
    align-self: flex-start;
}

/* 技能标签样式 */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* 链接样式 */
.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.link-card:hover {
    background-color: var(--color-4);
}

.link-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .profile-name {
        font-size: 2rem;
    }

    .project-card .project-image {
        height: 150px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}

/* 后台管理样式 */
.admin-panel {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* 文章卡片样式 */
.article-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-card .article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.article-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.article-card .article-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.article-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    color: #333;
}

.article-card .btn {
    align-self: flex-start;
}
