:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #e0e0e0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f2f5;
}

.date-bar {
    background-color: #f8f9fa;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.current-date {
    font-size: 14px;
    color: var(--text-color);
}

.right-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 15px;
    position: relative;
}

.search-box input {
    border: none;
    outline: none;
    padding: 5px;
    width: 200px;
    font-size: 14px;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.search-btn .icon {
    width: 16px;
    height: 16px;
}

.user-section {
    display: flex;
    gap: 10px;
}

.login-btn, .register-btn {
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.login-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.register-btn {
    background-color: var(--primary-color);
    color: white;
}

.header-icons .icon {
    width: 24px;
    height: 24px;
    margin-left: 15px;
}

.banner {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.slideshow-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 5s ease-in-out;
    transform: scale(1);
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide.active img {
    transform: scale(1.1);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 5s ease-in-out;
}

.dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

/* 淡入淡出动画 */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: 0.4;
    }
    to {
        opacity: 1;
    }
}

.main-nav {
    background-color: white;
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--border-color);
}

.main-nav a {
    display: block;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 16px;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.main-nav a.active:hover {
    color: var(--primary-color);
}

.programming-languages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 30px;
}

.language-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.language-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.language-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(74, 144, 226, 0.1) 50%);
    border-radius: 0 8px 0 0;
    z-index: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.language-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.language-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.language-info h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-info h3::after {
    content: '';
    display: block;
    height: 2px;
    flex: 1;
    background: linear-gradient(to right, var(--primary-color), transparent);
}

.advantage, .disadvantage, .feature, .application {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    padding: 10px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.advantage {
    border-left-color: #52c41a;
    background: rgba(82, 196, 26, 0.05);
}

.disadvantage {
    border-left-color: #ff4d4f;
    background: rgba(255, 77, 79, 0.05);
}

.language-info p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.6;
}

.language-stats {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.stat-label {
    width: 80px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    width: 40px;
    font-size: 14px;
    color: #666;
    text-align: right;
}

.progress {
    flex: 1;
    height: 4px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
    background-image: linear-gradient(45deg, 
        rgba(255,255,255,0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
    0% {
        background-position: 1rem 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* 添加模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.guest-login-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    padding: 6px 15px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    color: var(--primary-color);
    font-weight: 500;
}

.logout-btn {
    padding: 6px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-section {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.result-title {
    display: block;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 5px;
    text-decoration: none;
}

.result-text {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* 搜索结果高亮样式 */
.search-highlight {
    animation: highlight-pulse 3s;
}

@keyframes highlight-pulse {
    0% {
        background-color: rgba(74, 144, 226, 0.3);
    }
    70% {
        background-color: rgba(74, 144, 226, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* 搜索结果链接样式 */
.result-title {
    cursor: pointer;
}

.result-title:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .programming-languages {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}

/* 添加新的样式 */
.section-header {
    text-align: center;
    margin: 40px auto 20px;
    max-width: 800px;
    padding: 0 20px;
}

.section-header h2 {
    color: var(--text-color);
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.section-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 20px 0;
}

.section-footer {
    text-align: center;
    margin: 40px 0;
}

.section-footer .btn {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.section-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.section-footer .btn i {
    margin-right: 8px;
}

/* 语言网格布局样式 */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.language-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.language-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.language-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* 修改模态框样式以适应更多内容 */
.modal-content {
    width: 80%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 10vh auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .languages-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5vh auto;
    }
}

/* 页面布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 响应式布局 */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 20px;
    background-image: url('../img/24.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: calc(100vh - 120px); /* 减去header和nav的高度 */
} 