/* 全局样式 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --text-color: #1f2937;
    --light-bg: #f3f4f6;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* 导航栏 */
header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* 联系方式悬浮框 */
.contact-item {
    position: relative;
    cursor: pointer;
}

.contact-item::after {
    content: '您可以通过邮箱qinlixinyhk@162.com联系客服';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.contact-item .contact-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    user-select: all;
}

.contact-item:hover .contact-tooltip {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 10px);
}

/* 添加小三角 */
.contact-item::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--white);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.contact-item:hover::before {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 2px);
}

/* Hero区域 */
.hero {
    padding: 10rem 2rem 6rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/pattern.svg') center/cover;
    opacity: 0.1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    width: 160px;
    text-align: center;
}

.btn.primary {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(37, 99, 235, 0.1),
        rgba(59, 130, 246, 0.1)
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn.primary:hover::before {
    transform: translateX(0);
}

.btn.secondary {
    width: 420px;
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn.secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: translateX(-100%) rotate(10deg);
    transition: transform 0.6s ease;
    z-index: -1;
}

.btn.secondary:hover {
    border-color: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

.btn.secondary:hover::before {
    transform: translateX(0) rotate(0);
}

/* 特色区域 */
.section {
    padding: 6rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list li {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #4a5568;
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* 文章卡片 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
}

.article-card .article-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.article-card .article-title:hover {
    color: var(--primary-color);
}

.article-card .read-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.article-card .read-more svg {
    transition: transform 0.3s ease;
}

.article-card .read-more:hover {
    color: var(--secondary-color);
}

.article-card .read-more:hover svg {
    transform: translateX(5px);
}

/* CTA区域 */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    margin-bottom: 2rem;
}

/* 页脚 */
footer {
    background: var(--white);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.footer-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-color);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-bg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        padding: 8rem 1.5rem 4rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 4rem 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        padding: 0 2rem;
        max-width: 400px;
    }

    .btn {
        width: 100%;
        font-size: 1rem;
        padding: 0.9rem 1.5rem;
    }
}

/* 文章详情页样式 */
.article-content {
    padding: 6rem 0 4rem;
    background-color: var(--white);
}

.article-content .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tag {
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

time {
    color: #666;
    font-size: 0.9rem;
}

.article-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.4;
}

.article-excerpt {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.article-body {
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul, 
.article-body ol {
    margin: 1rem 0 1.5rem 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body pre {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e9ecef;
}

.article-body code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* 代码块hover效果 */
.article-body pre:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    cursor: pointer;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--secondary-color);
}

/* 页面头部样式 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 8rem 2rem 4rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* 课程页面样式 */
.course-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 20px;
    background: var(--light-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* 项目页面样式 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 课程卡片样式补充 */
.course-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-level {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.course-content {
    padding: 1.5rem;
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* 教程分类卡片样式优化 */
.tutorial-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.category-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.level-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* 教程列表样式 */
.tutorial-section {
    margin-bottom: 4rem;
}

.tutorial-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.tutorial-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tutorial-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tutorial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.tutorial-tag {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.tutorial-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.tutorial-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* 项目卡片样式补充 */
.project-preview {
    height: 200px;
    overflow: hidden;
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-tag {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* 项目列表页样式 */
.project-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.project-preview {
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
}

.project-difficulty {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-content {
    padding: 1.5rem;
}

.project-tag {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.project-features {
    background: var(--light-bg);
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.project-features h4 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.project-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-features li {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
    position: relative;
    color: #666;
}

.project-features li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.btn.primary {
    width: 100%;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .project-filters {
        flex-direction: column;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
} 