auto_trade_sys/frontend/src/components/Recommendations.css
薇薇安 9442fb632b a
2026-01-15 21:01:28 +08:00

549 lines
7.8 KiB
CSS

.recommendations-container {
padding: 20px;
max-width: 1400px;
margin: 0 auto;
}
.recommendations-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.recommendations-header h2 {
margin: 0;
color: #333;
}
.header-actions {
display: flex;
gap: 10px;
}
.btn-generate,
.btn-refresh {
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.btn-generate {
background-color: #4CAF50;
color: white;
}
.btn-generate:hover:not(:disabled) {
background-color: #45a049;
}
.btn-generate:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
.btn-refresh {
background-color: #2196F3;
color: white;
}
.btn-refresh:hover:not(:disabled) {
background-color: #0b7dda;
}
.filters {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.filter-select {
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
background-color: white;
cursor: pointer;
}
.error-message {
padding: 12px;
background-color: #ffebee;
color: #c62828;
border-radius: 4px;
margin-bottom: 20px;
}
.loading {
text-align: center;
padding: 40px;
color: #666;
}
.empty-state {
text-align: center;
padding: 60px 20px;
color: #666;
}
.empty-state p {
margin-bottom: 20px;
font-size: 16px;
}
.recommendations-list {
display: grid;
gap: 20px;
}
.recommendation-card {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s;
}
.recommendation-card:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 1px solid #f0f0f0;
}
.card-title {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.symbol {
font-size: 20px;
font-weight: bold;
color: #333;
}
.direction {
padding: 4px 12px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.direction.buy {
background-color: #4CAF50;
color: white;
}
.direction.sell {
background-color: #f44336;
color: white;
}
.status-badge {
padding: 4px 10px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.status-active {
background-color: #4CAF50;
color: white;
}
.status-executed {
background-color: #2196F3;
color: white;
}
.status-expired {
background-color: #9E9E9E;
color: white;
}
.status-cancelled {
background-color: #FF9800;
color: white;
}
.card-meta {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 5px;
}
.signal-strength {
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.signal-strong {
background-color: #4CAF50;
color: white;
}
.signal-medium {
background-color: #FF9800;
color: white;
}
.signal-weak {
background-color: #9E9E9E;
color: white;
}
.time {
font-size: 12px;
color: #666;
}
.card-content {
display: flex;
flex-direction: column;
gap: 15px;
}
.price-info {
display: flex;
gap: 20px;
flex-wrap: wrap;
}
.price-item {
display: flex;
align-items: center;
gap: 8px;
}
.price-item label {
font-weight: bold;
color: #666;
}
.price-item .positive {
color: #4CAF50;
}
.price-item .negative {
color: #f44336;
}
.recommendation-reason {
background-color: #f5f5f5;
padding: 12px;
border-radius: 4px;
}
.recommendation-reason strong {
display: block;
margin-bottom: 8px;
color: #333;
}
.recommendation-reason p {
margin: 0;
color: #666;
line-height: 1.6;
}
.suggested-params {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
padding: 15px;
background-color: #f9f9f9;
border-radius: 4px;
}
.param-item {
display: flex;
flex-direction: column;
gap: 5px;
}
.param-item label {
font-size: 12px;
color: #666;
font-weight: bold;
}
.param-item span {
font-size: 14px;
color: #333;
font-weight: 500;
}
.param-item.order-type {
grid-column: span 2;
}
.order-type-badge {
display: inline-block;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.order-type-badge.limit {
background-color: #2196F3;
color: white;
}
.order-type-badge.market {
background-color: #FF9800;
color: white;
}
.param-item.limit-price {
grid-column: span 2;
}
.limit-price-value {
display: flex;
flex-direction: column;
gap: 4px;
}
.price-diff {
font-size: 11px;
color: #666;
font-weight: normal;
font-style: italic;
}
.card-actions {
display: flex;
gap: 10px;
margin-top: 15px;
}
.btn-bookmark {
padding: 8px 16px;
background-color: #FF9800;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.btn-bookmark:hover:not(:disabled) {
background-color: #F57C00;
}
.btn-bookmark:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
.btn-toggle-details {
padding: 8px 16px;
background-color: #e0e0e0;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.btn-toggle-details:hover {
background-color: #d0d0d0;
}
.details-panel {
margin-top: 15px;
padding: 15px;
background-color: #f9f9f9;
border-radius: 4px;
border: 1px solid #e0e0e0;
}
.details-section {
margin-bottom: 20px;
}
.details-section:last-child {
margin-bottom: 0;
}
.details-section h4 {
margin: 0 0 10px 0;
color: #333;
font-size: 14px;
}
.indicators-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 10px;
}
.indicator-item {
display: flex;
justify-content: space-between;
padding: 8px;
background-color: white;
border-radius: 4px;
}
.indicator-item label {
font-size: 12px;
color: #666;
}
.indicator-item span {
font-size: 12px;
color: #333;
font-weight: 500;
}
.market-info {
display: flex;
flex-direction: column;
gap: 8px;
}
.info-item {
display: flex;
justify-content: space-between;
padding: 8px;
background-color: white;
border-radius: 4px;
}
.info-item label {
font-size: 12px;
color: #666;
}
.info-item span {
font-size: 12px;
color: #333;
font-weight: 500;
}
.bollinger-info {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.bollinger-item {
display: flex;
flex-direction: column;
padding: 8px;
background-color: white;
border-radius: 4px;
}
.bollinger-item label {
font-size: 12px;
color: #666;
margin-bottom: 4px;
}
.bollinger-item span {
font-size: 12px;
color: #333;
font-weight: 500;
}
.card-actions {
display: flex;
gap: 10px;
margin-top: 10px;
padding-top: 15px;
border-top: 1px solid #e0e0e0;
}
.btn-execute,
.btn-cancel {
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.btn-execute {
background-color: #2196F3;
color: white;
}
.btn-execute:hover {
background-color: #0b7dda;
}
.btn-cancel {
background-color: #9E9E9E;
color: white;
}
.btn-cancel:hover {
background-color: #757575;
}
/* 响应式设计 */
@media (max-width: 768px) {
.recommendations-container {
padding: 10px;
}
.recommendations-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
.card-header {
flex-direction: column;
gap: 10px;
}
.card-meta {
align-items: flex-start;
}
.suggested-params {
/* grid-template-columns: 1fr; */
display: flex;
width:80vw;
overflow-x: scroll;
}
.indicators-grid {
grid-template-columns: 1fr;
}
.bollinger-info {
grid-template-columns: 1fr;
}
.card-actions {
flex-direction: column;
}
.btn-execute,
.btn-cancel {
width: 100%;
}
}