
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f7f9fc;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;

}

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

/* 导航栏 */
header {
    background: linear-gradient(135deg, #6b5ce7, #ff7f50);
    color: white;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.logo span {
    color: #ffde59;
}

.logo-icon {
    font-size: 0rem;
    margin-right: 10px;
}

.logo-icon img{
    width: 40px;
    height: 40px;
}


.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-right: 25px;
    position: relative;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    padding: 5px 0;
}

.nav-links a:hover {
    color: #ffde59;
}

/* 用户头像下拉菜单样式 */
.user-dropdown {
    position: relative;
    margin-left: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    object-fit: cover;
}

.user-avatar:hover {
    border-color: #ffde59;
    transform: scale(1.05);
}

.user-menu {
    position: absolute;
    top: 110%;
    right: 0;
    background: white;
    width: 180px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

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

.user-menu-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background-color: #f5f5f5;
    color: #6b5ce7;
}

.user-menu-item i {
    margin-right: 10px;
    font-size: 1.1rem;
    color: #6b5ce7;
}

.logout-item {
    color: #ff5555;
}

.logout-item i {
    color: #ff5555;
}

/* 移动设备上的用户菜单 */
.mobile-user-menu {
    margin-top: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.mobile-user-header {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #ffde59;
    object-fit: cover;
}

.mobile-user-info {
    color: white;
}

.mobile-user-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.mobile-user-email {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 添加二级菜单样式 */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
     width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

.nav-links li:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.nav-dropdown li {
    margin: 0;
    width: 100%;
    list-style: none;
}

.nav-dropdown a {
    color: #333;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.nav-dropdown a:hover {
    background-color: #f5f5f5;
    color: #6b5ce7;
}

.dropdown-indicator {
    margin-left: 5px;
    font-size: 0.8rem;
}

.nav-right {
    display: flex;
    align-items: center;
}

.search-container {
    position: relative;
    margin-right: 15px;
}

.search-box {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: white;
    width: 180px;
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    width: 220px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

/* 编程环境按钮 */
.code-env-dropdown {
    position: relative;
    margin-right: 20px;
}

.code-env-btn {
    background: #ffde59;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.code-env-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.code-env-btn .code-icon {
    display: inline-block;
    font-size: 1.2rem;
}

.code-env-btn .dropdown-arrow {
    transition: transform 0.3s ease;
}

.code-env-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.code-env-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item .env-icon {
    margin-right: 8px;
    font-size: 1.2rem;
    color: #6b5ce7;
}

.dropdown-item .scratch-icon {
    color: #ff8c00;
}

.dropdown-item .python-icon {
    color: #306998;
}

/* 使登录按钮与编程环境按钮样式协调 */
.login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 9px 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* 移动导航 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: #6b5ce7;
    padding: 20px;
    transition: 0.5s ease-in-out;
    flex-direction: column;
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
    display: flex;
}

.mobile-nav .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 20px;
}

.mobile-nav .nav-links li {
    margin: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav .nav-links a {
    padding: 15px 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 移动导航中的子菜单 */
.mobile-nav .nav-dropdown {
    position: static;
    background: transparent;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav .nav-dropdown.active {
    max-height: 500px;
}

.mobile-nav .nav-dropdown li {
    border-bottom: none;
}

.mobile-nav .nav-dropdown a {
    color: rgba(255, 255, 255, 0.9);
    padding-left: 20px;
    border-bottom: none;
}

.mobile-nav .nav-dropdown a:hover {
    background: transparent;
    color: #ffde59;
}

.mobile-search {
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.mobile-search .search-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.mobile-login {
    width: 100%;
    text-align: center;
}

.mobile-login .login-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
}

/* 主要内容区 */
main {
    margin-top: 70px;
}

.btn {
    display: inline-block;
    background: #ffde59;
    color: #333;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    animation: fadeInUp 1.4s ease-out;
}

.btn:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 作品展示区域 */
.categories {
    padding: 20px 0;
    background-color: white;
    border-radius: 10px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.category-title {
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.view-all {
    color: #6b5ce7;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-all:hover {
    color: #ff7f50;
}

/* 项目列表 - 卡片样式 */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.project-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.project-content {
    padding: 15px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.project-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.project-author {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-author img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.project-tag {
    background: rgba(107, 92, 231, 0.1);
    color: #6b5ce7;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.project-description {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
}

.project-stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-date {
    color: #999;
}

/* 新闻区块 - 纵向列表 */
.news-section {
    padding: 40px 0;
    background-color: #f7f9fc;
}

.section-title {
    padding: 0 20px;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #6b5ce7, #ff7f50);
    margin: 10px 0 0;
    border-radius: 2px;
}

.news-list {
    width: 100%;
    padding: 0 20px;
}

.news-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.news-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.news-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.news-content {
    flex-grow: 1;
}

.news-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.news-excerpt {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date {
    color: #888;
    font-size: 0.75rem;
}

.news-more {
    display: block;
    text-align: right;
    color: #6b5ce7;
    text-decoration: none;
    padding: 10px 20px;
    font-weight: 500;
}

/* 页脚 */
footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-logo span {
    color: #ffde59;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #ffde59;
    color: #333;
    transform: translateY(-3px);
}

.copyright {
    margin-top: 20px;
    color: #999;
    font-size: 0.9rem;
}

.icp {
    margin-top: 20px;
    color: #999;
    font-size: 0.9rem;
}
.icp a {
    margin-top: 20px;
    color: #999;
    font-size: 0.8rem;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* 响应式设计 */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .projects {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .search-box {
        width: 150px;
    }

    .search-box:focus {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .nav-left .nav-links {
        display: none;
    }

    .nav-right {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero-section {
        height: 400px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .projects {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero-content {
        margin-left: 20px;
        margin-right: 20px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

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

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .projects {
        grid-template-columns: 1fr;
    }
}

/* 页脚搜索框样式 */
.footer-search {
    width: 100%;
    max-width: 500px;
    margin: 20px 0 25px;
}

.footer-search-form {
    display: flex;
    position: relative;
}

.footer-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 12px 20px;
    color: white;
    width: 100%;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.footer-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.footer-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(107, 92, 231, 0.3);
}

.footer-search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffde59;
    color: #333;
    border: none;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-search-button:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

/* 响应式调整 */
@media (max-width: 576px) {
    .footer-search {
        max-width: 100%;
    }

    .footer-search-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}


a.login-btn{
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 4px 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.no-comments-list{
    padding:30px;
}












/*!
 *  Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
 *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
 */
/* FONT PATH
 * -------------------------- */
 @font-face {
    font-family: 'FontAwesome';
    src: url('/static/font-awesome-4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');
    src: url('/static/font-awesome-4.7.0//fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('/static/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('/static/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('/static/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('/static/font-awesome-4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
    font-weight: normal;
    font-style: normal;
  }
  .fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .fa-qq:before {
    content: "\f1d6";
  }
  .fa-wechat:before,
  .fa-weixin:before {
    content: "\f1d7";
  }
  .fa-weibo:before {
    content: "\f18a";
  }