blob: 2882f5cff5c988528b3e101f0390389dae1ef43c [file] [log] [blame]
/* src/components/Dashboard.css */
.dashboard-container {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: #f8f9fa;
font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
/* 顶部栏样式 */
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 30px;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 1000;
}
.platform-name h2 {
margin: 0;
color: white;
font-size: 24px;
font-weight: 700;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
.user-actions {
display: flex;
align-items: center;
gap: 15px;
}
.admin-center-button {
padding: 8px 16px;
background-color: #ff7f50;
color: white;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.admin-center-button:hover {
background-color: #ff6347;
transform: translateY(-1px);
}
.user-info {
display: flex;
align-items: center;
gap: 10px;
color: white;
}
.user-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
object-fit: cover;
border: 2px solid rgba(255, 255, 255, 0.3);
}
.username {
font-weight: 600;
color: white !important;
}
.logout-button {
padding: 6px 12px;
background-color: transparent;
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
}
.logout-button:hover {
background-color: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.5);
}
/* 导航标签样式 */
.nav-tabs {
display: flex;
background-color: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
padding: 0 30px;
}
.tab-button {
padding: 14px 24px;
background: none;
border: none;
border-bottom: 3px solid transparent;
cursor: pointer;
font-size: 15px;
font-weight: 600;
color: #666;
transition: all 0.2s;
position: relative;
}
.tab-button:hover {
color: #1e3c72;
}
.tab-button.active {
color: #1e3c72;
border-bottom-color: #1e3c72;
}
.tab-button.active::after {
content: '';
position: absolute;
bottom: -3px;
left: 0;
right: 0;
height: 3px;
background-color: #1e3c72;
}
/* 内容区域样式 */
.content-area {
flex-grow: 1;
padding: 25px 30px;
background-color: white;
margin: 20px;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.section-search-container {
display: flex;
margin-bottom: 25px;
gap: 10px;
}
.section-search-input {
flex: 1;
padding: 10px 16px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
transition: all 0.2s;
}
.section-search-input:focus {
border-color: #1e3c72;
box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.2);
}
.search-button, .reset-button {
padding: 10px 18px;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.search-button {
background-color: #1e3c72;
color: white;
}
.search-button:hover {
background-color: #2a5298;
transform: translateY(-1px);
}
.reset-button {
background-color: #f1f1f1;
color: #555;
}
.reset-button:hover {
background-color: #e0e0e0;
}
/* 轮播图样式 */
.carousel-container {
position: relative;
width: 100%;
height: 200px;
overflow: hidden;
margin-bottom: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.carousel-slide {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.5s ease-in-out;
}
.carousel-slide.active {
opacity: 1;
}
.carousel-image {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 30px;
color: white;
background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}
.carousel-image h3 {
font-size: 28px;
margin: 0 0 10px 0;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}
.carousel-image p {
margin: 5px 0;
font-size: 16px;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
.carousel-dots {
position: absolute;
bottom: 15px;
left: 0;
right: 0;
display: flex;
justify-content: center;
gap: 8px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.5);
cursor: pointer;
transition: all 0.2s;
}
.dot.active {
background-color: white;
transform: scale(1.2);
}
/* 公告网格样式 */
.announcement-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.announcement-card {
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
transition: all 0.2s;
border-left: 4px solid #1e3c72;
cursor: pointer;
}
.announcement-card:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.announcement-card h3 {
margin: 0 0 12px 0;
color: #1e3c72;
font-size: 18px;
font-weight: 600;
}
.announcement-card p {
margin: 0 0 12px 0;
color: #555;
line-height: 1.5;
font-size: 14px;
}
.announcement-footer {
display: flex;
justify-content: space-between;
align-items: center;
color: #888;
font-size: 13px;
}
/* 推荐区域样式 */
.recommend-section {
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #eee;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.section-title {
margin: 0;
color: #1e3c72;
font-size: 20px;
font-weight: 600;
}
.refresh-btn {
padding: 8px 16px;
background-color: #f1f1f1;
border: none;
border-radius: 6px;
font-weight: 600;
color: #555;
cursor: pointer;
transition: all 0.2s;
}
.refresh-btn:hover {
background-color: #e0e0e0;
}
.refresh-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.recommend-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 20px;
}
.recommend-card {
background-color: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
transition: all 0.2s;
cursor: pointer;
}
.recommend-card:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.card-poster {
height: 120px;
background-color: #f5f5f5;
display: flex;
align-items: center;
justify-content: center;
}
.poster-image {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
font-size: 36px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
}
.card-info {
padding: 15px;
}
.card-title {
margin: 0 0 8px 0;
font-size: 16px;
font-weight: 600;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-meta {
margin: 0 0 5px 0;
font-size: 13px;
color: #666;
}
.card-subtitle {
margin: 0;
font-size: 13px;
color: #888;
}
.card-stats {
padding: 10px 15px;
border-top: 1px solid #eee;
font-size: 13px;
color: #666;
}
.no-recommendations {
grid-column: 1 / -1;
text-align: center;
padding: 30px;
color: #888;
font-size: 15px;
}
/* 上传按钮样式 */
.upload-header {
margin-bottom: 20px;
}
.upload-btn {
padding: 10px 20px;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
color: white;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
display: inline-flex;
align-items: center;
gap: 8px;
}
.upload-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
}
/* 筛选区域样式 */
.filter-section {
background-color: white;
padding: 15px 20px;
border-radius: 8px;
margin-bottom: 25px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.filter-group {
margin-bottom: 15px;
}
.filter-group h4 {
margin: 0 0 10px 0;
font-size: 14px;
color: #555;
font-weight: 600;
}
.filter-options {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.filter-btn {
padding: 6px 12px;
background-color: #f5f5f5;
color: #333; /* 改为黑字 */
border: 1px solid #ddd;
border-radius: 4px;
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
}
.filter-btn:hover {
border-color: #1e3c72;
color: #fbfbfc;
}
.filter-btn.active {
background-color: #1e3c72;
color: white;
border-color: #1e3c72;
}
.confirm-btn {
padding: 8px 20px;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
color: white;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.confirm-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
}
/* 资源列表样式 */
.resource-list {
display: grid;
gap: 15px;
}
.resource-item {
display: flex;
align-items: center;
padding: 15px;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
transition: all 0.2s;
cursor: pointer;
}
.resource-item:hover {
transform: translateY(-3px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.resource-poster {
margin-right: 15px;
flex-shrink: 0;
}
.poster-image {
width: 80px;
height: 110px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
font-size: 28px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.resource-info {
flex-grow: 1;
min-width: 0;
}
.resource-title {
margin: 0 0 8px 0;
font-size: 16px;
font-weight: 600;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.resource-meta {
margin: 0 0 5px 0;
font-size: 13px;
color: #666;
}
.resource-subtitle {
margin: 0;
font-size: 13px;
color: #888;
}
.resource-stats {
margin-right: 20px;
text-align: right;
min-width: 120px;
}
.stat {
display: block;
font-size: 13px;
color: #666;
margin-bottom: 5px;
}
.download-btn {
padding: 8px 16px;
background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
color: white;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
white-space: nowrap;
}
.download-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}
.delete-btn {
padding: 8px 16px;
background: linear-gradient(135deg, #ff5e62 0%, #ff2400 100%);
color: white;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
margin-left: 10px;
white-space: nowrap;
}
.delete-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(255, 94, 98, 0.3);
}
/* 分页样式 */
.pagination {
display: flex;
justify-content: center;
margin: 30px 0 20px;
gap: 8px;
}
.pagination button {
padding: 8px 14px;
border: 1px solid #ddd;
background-color: white;
color: #333;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
font-size: 14px;
}
.pagination button:hover:not(.active):not(:disabled) {
border-color: #1e3c72;
color: #1e3c72;
}
.pagination button.active {
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
color: white;
border-color: #1e3c72;
}
.pagination button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* 修改后的模态框样式 */
.post-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999; /* 确保在最上层 */
}
.upload-modal,
.post-modal,
.download-modal {
background-color: white;
padding: 25px;
border-radius: 8px;
width: 500px;
max-width: calc(100% - 40px);
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
position: relative;
margin: 20px auto; /* 添加一些外边距 */
max-height: 90vh; /* 限制最大高度 */
overflow-y: auto; /* 允许内容滚动 */
}
/* 针对移动端的调整 */
@media (max-width: 576px) {
.post-modal {
padding: 20px 15px;
width: 100%;
margin: 10px;
}
}
/* 确保模态框关闭按钮在最上层 */
.modal-close-btn {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 22px;
color: #888;
cursor: pointer;
transition: all 0.2s;
z-index: 1;
}
.modal-close-btn:hover {
color: #555;
transform: rotate(90deg);
}
/* 表单样式 */
.form-group {
margin-bottom: 18px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #555;
font-size: 14px;
}
.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
width: 100%;
padding: 10px 12px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
transition: all 0.2s;
}
.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
border-color: #1e3c72;
box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.2);
}
.form-group textarea {
min-height: 100px;
resize: vertical;
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
margin-top: 25px;
}
.cancel-btn {
padding: 10px 18px;
background-color: #f5f5f5;
color: #555;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.cancel-btn:hover {
background-color: #e0e0e0;
}
.submit-btn, .confirm-btn {
padding: 10px 18px;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
color: white;
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.submit-btn:hover, .confirm-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
}
/* 进度条样式 */
.progress-container {
height: 10px;
background-color: #f0f0f0;
border-radius: 5px;
margin: 15px 0;
overflow: hidden;
}
.progress-bar {
height: 100%;
background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
transition: width 0.3s;
border-radius: 5px;
}
/* 加载和错误提示 */
.loading {
text-align: center;
padding: 30px;
color: #666;
font-size: 16px;
}
.error {
text-align: center;
padding: 20px;
color: #e74c3c;
font-size: 16px;
background-color: #fdecea;
border-radius: 6px;
margin: 20px 0;
}
/* 响应式调整 */
@media (max-width: 768px) {
.top-bar {
padding: 10px 15px;
}
.nav-tabs {
padding: 0 15px;
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
.content-area {
padding: 15px;
margin: 10px;
}
.announcement-grid, .recommend-grid {
grid-template-columns: 1fr;
}
.resource-item {
flex-direction: column;
align-items: flex-start;
}
.resource-poster {
margin-right: 0;
margin-bottom: 15px;
}
.resource-stats {
margin-right: 0;
margin-top: 10px;
text-align: left;
width: 100%;
}
}