645 lines
12 KiB
CSS
645 lines
12 KiB
CSS
/* 自制卡牌通用样式 */
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
}
|
|
|
|
/* 卡牌列表页样式 */
|
|
.filters {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-bottom: 20px;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
position: sticky; /* 使筛选器固定在顶部 */
|
|
top: 0;
|
|
z-index: 100;
|
|
background-color: rgba(10, 10, 10, 0.95);
|
|
padding: 15px 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.filter-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.filter-group select {
|
|
padding: 8px;
|
|
background-color: #222;
|
|
color: #e0e0e0;
|
|
border: 1px solid #444;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.cards-wrapper {
|
|
margin-top: 20px;
|
|
overflow-y: auto; /* 确保内容可滚动 */
|
|
padding-bottom: 50px; /* 添加底部空间 */
|
|
}
|
|
|
|
.cards-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr); /* 修改为一行显示两张卡牌 */
|
|
gap: 20px;
|
|
}
|
|
|
|
.card-item {
|
|
background-color: rgba(30, 30, 35, 0.8);
|
|
border: 1px solid #600;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
transition: all 0.3s ease;
|
|
cursor: pointer;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%; /* 确保所有卡片高度相同 */
|
|
}
|
|
|
|
.card-item:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 5px 15px rgba(153, 0, 0, 0.4);
|
|
background-color: rgba(96, 0, 0, 0.2);
|
|
}
|
|
|
|
.card-header {
|
|
padding: 15px;
|
|
border-bottom: 1px solid #333;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.card-avatar {
|
|
font-size: 2rem;
|
|
}
|
|
|
|
.card-info h3 {
|
|
margin: 0 0 5px 0;
|
|
font-size: 1.2rem;
|
|
}
|
|
|
|
.card-info p {
|
|
margin: 0;
|
|
color: #999;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.card-content {
|
|
padding: 15px;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.card-title {
|
|
margin: 0 0 10px 0;
|
|
color: #d4af37;
|
|
}
|
|
|
|
.card-text {
|
|
margin: 0;
|
|
color: #e0e0e0;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 3;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.card-footer {
|
|
padding: 10px 15px;
|
|
border-top: 1px solid #333;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
background-color: rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.card-creator {
|
|
font-size: 0.8rem;
|
|
color: #999;
|
|
}
|
|
|
|
.card-votes {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.vote-positive {
|
|
color: #4caf50;
|
|
}
|
|
|
|
.vote-negative {
|
|
color: #f44336;
|
|
}
|
|
|
|
.vote-neutral {
|
|
color: #999;
|
|
}
|
|
|
|
.loading-indicator {
|
|
text-align: center;
|
|
padding: 40px;
|
|
grid-column: 1 / -1;
|
|
color: #999;
|
|
font-style: italic;
|
|
}
|
|
|
|
/* 弹窗样式 */
|
|
.card-modal {
|
|
display: none;
|
|
position: fixed;
|
|
z-index: 1000;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: auto;
|
|
background-color: rgba(0, 0, 0, 0.8);
|
|
animation: fadeIn 0.3s;
|
|
}
|
|
|
|
.modal-content {
|
|
background-color: rgba(30, 30, 35, 0.95);
|
|
margin: 5% auto;
|
|
padding: 20px;
|
|
border: 2px solid #600;
|
|
border-radius: 8px;
|
|
width: 90%;
|
|
max-width: 700px;
|
|
box-shadow: 0 0 30px rgba(153, 0, 0, 0.7);
|
|
animation: slideIn 0.3s;
|
|
max-height: 90vh;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.close-modal {
|
|
color: #999;
|
|
float: right;
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
transition: color 0.3s;
|
|
}
|
|
|
|
.close-modal:hover {
|
|
color: #d4af37;
|
|
}
|
|
|
|
.card-detail-container {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.card-detail-container .card-title {
|
|
margin-bottom: 15px;
|
|
font-size: 1.8rem;
|
|
}
|
|
|
|
.card-detail-container .card-creator,
|
|
.card-detail-container .card-date {
|
|
margin-bottom: 10px;
|
|
color: #999;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.card-description {
|
|
margin: 20px 0;
|
|
padding: 15px;
|
|
background-color: rgba(0, 0, 0, 0.3);
|
|
border-radius: 5px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.card-options {
|
|
margin: 20px 0;
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 20px;
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
.card-options {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
.card-options .option {
|
|
padding: 15px;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.card-options .option:first-child {
|
|
background-color: rgba(74, 111, 181, 0.2);
|
|
border: 1px solid rgba(74, 111, 181, 0.5);
|
|
}
|
|
|
|
.card-options .option:last-child {
|
|
background-color: rgba(179, 57, 57, 0.2);
|
|
border: 1px solid rgba(179, 57, 57, 0.5);
|
|
}
|
|
|
|
.card-options .option h3 {
|
|
margin-top: 0;
|
|
margin-bottom: 10px;
|
|
font-size: 1.2rem;
|
|
}
|
|
|
|
.effects {
|
|
margin-top: 15px;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
}
|
|
|
|
.effect-tag {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 5px 8px;
|
|
border-radius: 3px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
/* 新的效果标签样式 */
|
|
.effect-tag.positive {
|
|
background-color: rgba(40, 60, 40, 0.9); /* 深绿色/几乎黑色的背景 */
|
|
color: #ffffff; /* 纯白色文字 */
|
|
border: 1px solid #4caf50;
|
|
font-weight: 500;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* 添加文字阴影增强可读性 */
|
|
}
|
|
|
|
.effect-tag.negative {
|
|
background-color: rgba(60, 40, 40, 0.9); /* 深红色/几乎黑色的背景 */
|
|
color: #ffffff; /* 纯白色文字 */
|
|
border: 1px solid #f44336;
|
|
font-weight: 500;
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* 添加文字阴影增强可读性 */
|
|
}
|
|
|
|
.card-voting {
|
|
margin-top: 30px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid #333;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
.vote-count {
|
|
font-size: 1.2rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.vote-buttons {
|
|
display: flex;
|
|
gap: 15px;
|
|
}
|
|
|
|
.btn-vote {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 15px;
|
|
font-size: 1rem;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.upvote {
|
|
background-color: rgba(76, 175, 80, 0.2);
|
|
border: 1px solid rgba(76, 175, 80, 0.5);
|
|
color: #81c784;
|
|
}
|
|
|
|
.downvote {
|
|
background-color: rgba(244, 67, 54, 0.2);
|
|
border: 1px solid rgba(244, 67, 54, 0.5);
|
|
color: #e57373;
|
|
}
|
|
|
|
.upvote:hover {
|
|
background-color: rgba(76, 175, 80, 0.4);
|
|
box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
|
|
}
|
|
|
|
.downvote:hover {
|
|
background-color: rgba(244, 67, 54, 0.4);
|
|
box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
|
|
}
|
|
|
|
.upvote.voted {
|
|
background-color: rgba(76, 175, 80, 0.6);
|
|
box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
|
|
}
|
|
|
|
.downvote.voted {
|
|
background-color: rgba(244, 67, 54, 0.6);
|
|
box-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
|
|
}
|
|
|
|
/* 创建卡牌页面样式 */
|
|
.card-form-container {
|
|
background-color: rgba(30, 30, 35, 0.8);
|
|
border: 1px solid #600;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin-top: 20px;
|
|
margin-bottom: 40px; /* 添加底部空间确保滚动 */
|
|
overflow-y: visible; /* 确保内容可以滚动 */
|
|
}
|
|
|
|
.form-section {
|
|
margin-bottom: 30px;
|
|
padding-bottom: 20px;
|
|
border-bottom: 1px solid #333;
|
|
}
|
|
|
|
.form-section:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.form-section h2 {
|
|
margin-bottom: 20px;
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
color: #d4af37;
|
|
}
|
|
|
|
.form-group input,
|
|
.form-group textarea,
|
|
.form-group select {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background-color: #222;
|
|
border: 1px solid #444;
|
|
color: #fff;
|
|
border-radius: 4px;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.form-group input:focus,
|
|
.form-group textarea:focus,
|
|
.form-group select:focus {
|
|
outline: none;
|
|
border-color: #600;
|
|
box-shadow: 0 0 5px rgba(153, 0, 0, 0.5);
|
|
}
|
|
|
|
.form-group input[type="number"] {
|
|
width: 100px;
|
|
}
|
|
|
|
.required {
|
|
color: #f44336;
|
|
}
|
|
|
|
.character-count {
|
|
text-align: right;
|
|
font-size: 0.8rem;
|
|
color: #999;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.effects-group h3 {
|
|
margin-bottom: 15px;
|
|
font-size: 1.2rem;
|
|
color: #d4af37;
|
|
}
|
|
|
|
.effects-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 15px;
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
.effects-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
.effect-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.effect-item label {
|
|
width: 120px;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.total-effects {
|
|
margin-top: 15px;
|
|
text-align: right;
|
|
font-size: 1rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.effect-warning {
|
|
color: #f44336;
|
|
font-size: 0.9rem;
|
|
margin-top: 5px;
|
|
display: none;
|
|
}
|
|
|
|
.form-actions {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-top: 30px;
|
|
}
|
|
|
|
/* 表情符号选择器 */
|
|
.emoji-picker {
|
|
margin-top: 10px;
|
|
padding: 10px;
|
|
background-color: rgba(0, 0, 0, 0.3);
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.emoji-group {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
}
|
|
|
|
.emoji-item {
|
|
font-size: 1.5rem;
|
|
cursor: pointer;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.emoji-item:hover {
|
|
transform: scale(1.2);
|
|
}
|
|
|
|
/* 动画 */
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
from { transform: translateY(-50px); opacity: 0; }
|
|
to { transform: translateY(0); opacity: 1; }
|
|
}
|
|
|
|
/* 响应式适配 */
|
|
@media (max-width: 768px) {
|
|
.filters {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.cards-grid {
|
|
grid-template-columns: repeat(2, 1fr); /* 保持一行两张卡牌 */
|
|
}
|
|
|
|
.modal-content {
|
|
width: 95%;
|
|
margin: 10% auto;
|
|
}
|
|
|
|
.card-options {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.container {
|
|
padding: 10px;
|
|
}
|
|
|
|
.cards-grid {
|
|
grid-template-columns: repeat(2, 1fr); /* 即使在小屏幕上也保持两列 */
|
|
gap: 10px; /* 减小间距 */
|
|
}
|
|
|
|
.form-actions {
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.form-actions button {
|
|
width: 100%;
|
|
}
|
|
|
|
/* 调整卡片内容,让它在小屏幕上更紧凑 */
|
|
.card-header {
|
|
padding: 10px;
|
|
}
|
|
|
|
.card-content {
|
|
padding: 10px;
|
|
}
|
|
|
|
.card-footer {
|
|
padding: 8px 10px;
|
|
}
|
|
|
|
.card-avatar {
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.card-info h3 {
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.card-info p {
|
|
font-size: 0.8rem;
|
|
}
|
|
}
|
|
|
|
/* 浅色主题适配 */
|
|
@media (prefers-color-scheme: light) {
|
|
.card-item, .card-form-container, .modal-content {
|
|
background-color: rgba(240, 240, 245, 0.9);
|
|
color: #333;
|
|
}
|
|
|
|
.card-title, h1, h2, h3 {
|
|
color: #600;
|
|
}
|
|
|
|
.card-text, .form-group label {
|
|
color: #333;
|
|
}
|
|
|
|
.form-group input, .form-group textarea, .form-group select {
|
|
background-color: #fff;
|
|
border-color: #ccc;
|
|
color: #333;
|
|
}
|
|
}
|
|
|
|
/* 确保可以滚动的页面设置 */
|
|
.custom-cards-page, .create-card-page {
|
|
overflow-y: auto !important;
|
|
height: auto !important;
|
|
position: relative !important;
|
|
}
|
|
|
|
/* 页面底部添加额外空间 */
|
|
.custom-cards-page footer, .create-card-page footer {
|
|
margin-top: 80px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
/* 空状态处理 */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 40px 20px;
|
|
grid-column: 1 / -1;
|
|
}
|
|
|
|
.empty-state h2 {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.empty-state .btn {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
/* 错误消息样式 */
|
|
.error-message {
|
|
background-color: rgba(153, 0, 0, 0.3);
|
|
border: 1px solid #600;
|
|
padding: 15px;
|
|
margin: 20px 0;
|
|
border-radius: 4px;
|
|
color: #ff9999;
|
|
text-align: center;
|
|
}
|
|
|
|
/* 消息弹出提示样式 */
|
|
.message-popup {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(100px);
|
|
background-color: rgba(0, 0, 0, 0.8);
|
|
color: white;
|
|
padding: 12px 20px;
|
|
border-radius: 5px;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
z-index: 10000;
|
|
transition: transform 0.3s ease;
|
|
text-align: center;
|
|
max-width: 80%;
|
|
}
|
|
|
|
.message-popup.show {
|
|
transform: translateX(-50%) translateY(0);
|
|
} |