/* 导航栏 */
.main-nav {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    gap: 2rem;
    box-shadow: var(--shadow-sm);
}

.main-nav li {
    list-style: none;
}

.main-nav .nav-link {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

.main-nav .nav-link i {
    font-size: 1.125rem;
    opacity: 0.8;
}

.main-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--background-light);
    transform: translateY(-1px);
}

.main-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.main-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.main-nav .nav-link:hover::after,
.main-nav .nav-link.active::after {
    width: calc(100% - 2rem);
}

/* 卡片组件 */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--background-dark);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #f87171;
}

/* 标签样式 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.tag-primary {
    background: var(--primary-light);
    color: white;
}

.tag-success {
    background: var(--success-color);
    color: white;
}

.tag-warning {
    background: var(--warning-color);
    color: white;
}

.tag-error {
    background: var(--error-color);
    color: white;
}

/* 进度条 */
.progress {
    background: var(--background-dark);
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width var(--transition-normal);
    position: relative;
}

.progress-bar .progress-text {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 代码编辑器 */
.code-editor {
    background: var(--editor-bg);
    color: var(--editor-text);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: 'Fira Code', monospace;
    line-height: 1.5;
    overflow-x: auto;
    position: relative;
}

.code-editor pre {
    margin: 0;
    padding: 0;
}

.code-editor code {
    font-family: inherit;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 1rem 0.5rem;
    border-right: 1px solid var(--editor-line);
    color: var(--text-light);
    user-select: none;
    text-align: right;
}

.code-content {
    margin-left: 3rem;
}

/* 搜索框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 10px;
    min-width: 200px;
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    padding: 5px;
    width: 100%;
    font-size: 14px;
}

.search-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.search-btn .icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    object-fit: contain;
}

.search-btn:hover .icon {
    opacity: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

/* 通知提示 */
.notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.notification-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* 通用模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: all var(--transition-normal);
}

.modal .close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    transition: all var(--transition-normal);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 语言模态框特定样式 */
#languageModal .modal-content {
    max-width: 1200px;
}

#languageModal .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

#languageModal .close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: all var(--transition-normal);
    line-height: 1;
}

#languageModal .close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

#languageModal .languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

#languageModal .language-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

#languageModal .language-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#languageModal .language-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#languageModal .language-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

#languageModal .language-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

#languageModal .language-stats {
    margin-bottom: 1rem;
}

#languageModal .stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

#languageModal .stat-row span {
    min-width: 60px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#languageModal .progress {
    flex: 1;
    height: 10px;
    background: var(--background-dark);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

#languageModal .progress-bar {
    height: 100%;
    background: var(--primary-color);
    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-bar-stripes 1s linear infinite;
    transition: width var(--transition-normal);
    position: relative;
}

#languageModal .progress-bar .progress-text {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

/* 导航栏响应式设计 */
@media (max-width: 768px) {
    .main-nav {
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .main-nav .nav-link {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .main-nav .nav-link i {
        font-size: 1rem;
    }
    
    .main-nav .nav-link span {
        display: none;  /* 在小屏幕上只显示图标 */
    }
} 

/* 顶部状态栏 */
.date-bar {
    background: var(--background-dark);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-bar .current-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.date-bar .right-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    font-weight: 500;
    color: var(--text-primary);
}

/* 登录按钮组 */
.login-buttons {
    display: flex;
    gap: 0.75rem;
}

.login-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.register-btn {
    background: var(--background-dark);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.register-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .date-bar {
        padding: 0.5rem 1rem;
    }
    
    .search-box {
        min-width: auto;
        width: 200px;
    }
    
    .user-section {
        gap: 0.5rem;
    }
    
    .login-buttons {
        gap: 0.5rem;
    }
    
    .login-btn,
    .register-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        width: 150px;
    }
    
    .current-date {
        display: none;
    }
} 

/* 语言网格布局 */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.language-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.language-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.language-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.language-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* 修改语言统计和按钮的布局 */
.language-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.language-stats {
    flex: 1;
    margin-right: 15px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-row span {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.progress {
    flex: 1;
    height: 6px;
    background-color: var(--background-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    position: relative;
}

.progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-view-details {
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.btn-view-details:hover {
    background-color: var(--primary-dark);
} 