/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 顶部导航栏 */
.app-header {
    background-color: #1aad19;
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.app-header h1 {
    font-size: 28px;
    font-weight: bold;
}

.login-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
}

.login-btn {
    color: white;
    background-color: rgba(255,255,255,0.2);
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: rgba(255,255,255,0.3);
}

/* 一级菜单 */
.main-nav {
    display: flex;
    background-color: #f0f0f0;
    width: 100%;
    border-top: 1px solid #e0e0e0;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.nav-item {
    position: relative;
    flex: 1;
}

.nav-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn:hover {
    background-color: #e0e0e0;
}

.nav-btn.active {
    background-color: white;
    color: #1aad19;
    border-top: 3px solid #1aad19;
}

/* 二级菜单样式 */
.sub-nav {
    display: none;
    background-color: white;
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
}

.sub-nav-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-nav-btn:hover {
    background-color: #f0f9eb;
    color: #1aad19;
}

.sub-nav-btn.active {
    color: #1aad19;
    border-bottom: 2px solid #1aad19;
}

/* 下拉菜单 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f0f9eb;
    color: #1aad19;
}

/* 登录状态显示 */
.login-status {
    background-color: #f0f9eb;
    color: #52c41a;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #e6f7ff;
}

/* 主要内容区域 */
.main-content {
    padding: 20px;
    padding-bottom: 70px; /* 为底部导航栏留出空间 */
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 资讯分享页面 */
.news-list h2 {
    margin-bottom: 20px;
    color: #333;
}

.news-item {
    background-color: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 0;
    border: 1px solid #e0e0e0;
}

.news-item h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

.news-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.news-summary {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

.read-more {
    background-color: #1aad19;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #179b16;
}

/* 案例展示部分 */
.cases-section {
    margin-top: 40px;
}

.cases-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.cases-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.case-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.case-cover {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.case-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

.case-item:hover .case-cover img {
    transform: scale(1.05);
}

/* 图片加载动画 */
.case-cover {
    position: relative;
    overflow: hidden;
}

.case-cover:not(.loaded)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%, #e0e0e0 100%);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
    z-index: 1;
}

.case-cover img.loaded {
    opacity: 1;
}

/* 视频缩略图加载动画 */
.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail:not(.loaded)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%, #e0e0e0 100%);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
    z-index: 1;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    position: relative;
    z-index: 2;
}

.video-thumbnail img.loaded {
    opacity: 1;
}

.video-thumbnail img.error {
    opacity: 1;
    background-color: #f0f0f0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="%23ccc" d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm-2-22h4v12h-4zm0 16h4v4h-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

/* 确保播放图标在加载动画之上显示 */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 3;
}

.case-cover img.error {
    opacity: 1;
    background-color: #f0f0f0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="%23ccc" d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm-2-22h4v12h-4zm0 16h4v4h-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.case-item h3 {
    padding: 15px 15px 10px;
    font-size: 16px;
    color: #333;
}

.case-summary {
    padding: 0 15px 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.view-case {
    margin: 0 15px 15px;
    background-color: #1aad19;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    width: calc(100% - 30px);
}

.view-case:hover {
    background-color: #179b16;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h2 {
    font-size: 18px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* 登录标签页 */
.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #1aad19;
    border-bottom: 2px solid #1aad19;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    background-color: #1aad19;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #179b16;
}

.register-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.register-link a {
    color: #1aad19;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* 案例详情模态框 */
#case-detail-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5% auto;
}

/* 视频播放模态框 */
.video-modal-content {
    max-width: 90%;
    max-height: 90vh;
    width: 800px;
    margin: 5% auto;
}

.video-player-container {
    padding: 20px 0;
}

.video-player-container video {
    border-radius: 8px;
}

.case-detail-title {
    margin-bottom: 20px;
    color: #333;
}

.case-detail-body {
    line-height: 1.6;
    color: #666;
}

.case-detail-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.case-detail-body h4 {
    margin-top: 15px;
    margin-bottom: 8px;
    color: #333;
}

.case-detail-body p {
    margin-bottom: 10px;
}

.case-detail-body ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.case-detail-body li {
    margin-bottom: 5px;
}

.case-detail-body img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
}

/* 微课课程样式 */
.courses-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.course-content {
    margin-top: 20px;
}

.course-level {
    display: none;
}

.course-level.active {
    display: block;
}

.course-level h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 视频列表 */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.video-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.video-item:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.video-item:hover .play-icon {
    background-color: rgba(26, 173, 25, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-item:hover .video-title {
    color: #1aad19;
}

.video-item.playing {
    border-color: #1aad19;
    box-shadow: 0 0 0 2px rgba(26, 173, 25, 0.2);
}

.video-thumbnail {
    width: 100%;
    height: 160px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.play-icon::before {
    content: '▶';
    margin-left: 2px;
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.video-duration {
    font-size: 12px;
    color: #999;
}

/* 视频播放器 */
.course-player {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 0;
    margin-top: 20px;
}

.course-player video {
    width: 100%;
    border-radius: 0;
}

/* 作品评价页面 */
.evaluation-container h2 {
    margin-bottom: 20px;
    color: #333;
}

.upload-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.upload-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.upload-section p {
    margin-bottom: 15px;
    color: #666;
}

.upload-section input[type="file"] {
    margin-bottom: 20px;
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.result-section {
    background-color: white;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.result-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.score-overall {
    margin-bottom: 20px;
}

.score-overall h4 {
    color: #333;
}

#total-score {
    font-size: 24px;
    font-weight: bold;
    color: #1aad19;
}

.radar-chart {
    margin-bottom: 20px;
}

.radar-chart h4 {
    margin-bottom: 10px;
    color: #333;
}

.improvement-suggestions {
    margin-bottom: 20px;
}

.improvement-suggestions h4 {
    margin-bottom: 10px;
    color: #333;
}

#suggestions-list {
    color: #666;
    padding-left: 20px;
}

#suggestions-list li {
    margin-bottom: 5px;
}

.history-section {
    background-color: white;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#submission-history {
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cases-list {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        font-size: 14px;
        padding: 12px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .app-header h1 {
        font-size: 20px;
    }
    
    .video-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .video-thumbnail {
        height: 100px;
    }
}

/* 添加按钮样式 */
.add-news-btn {
    background-color: #1aad19;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.add-news-btn:hover {
    background-color: #179b16;
}

/* 评分结果样式 */
#result-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 历史记录样式 */
#submission-history ul {
    list-style: none;
    padding: 0;
}

#submission-history li {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

/* 微课课程二级菜单显示 */
#courses-subnav {
    display: flex;
}