stock/frontend/css/style.css

804 lines
12 KiB
CSS

/* 基础样式重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f8f9fa;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* 导航栏样式 */
.navbar {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1rem 0;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
position: sticky;
top: 0;
z-index: 1000;
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.nav-logo {
font-size: 1.5rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 10px;
}
.nav-menu {
display: flex;
list-style: none;
gap: 2rem;
}
.nav-link {
color: white;
text-decoration: none;
padding: 0.5rem 1rem;
border-radius: 5px;
transition: background-color 0.3s;
}
.nav-link:hover,
.nav-link.active {
background-color: rgba(255,255,255,0.2);
}
/* 主内容区域 */
.main-content {
padding: 2rem 0;
}
.section-title {
font-size: 2rem;
margin-bottom: 2rem;
color: #2c3e50;
text-align: center;
}
/* 概览卡片样式 */
.overview-section {
margin-bottom: 3rem;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin-top: 2rem;
}
.stat-card {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
display: flex;
align-items: center;
gap: 1rem;
transition: transform 0.3s;
}
.stat-card:hover {
transform: translateY(-5px);
}
.stat-icon {
font-size: 2.5rem;
color: #667eea;
}
.stat-info h3 {
font-size: 2rem;
font-weight: 600;
color: #2c3e50;
}
.stat-info p {
color: #7f8c8d;
margin-top: 0.5rem;
}
/* 内容区域切换 */
.content-section {
display: none;
}
.content-section.active {
display: block;
}
/* 搜索栏样式 */
.search-bar {
display: flex;
gap: 10px;
margin-bottom: 2rem;
max-width: 400px;
}
.search-bar input {
flex: 1;
padding: 0.75rem;
border: 2px solid #e0e0e0;
border-radius: 5px;
font-size: 1rem;
}
.search-bar button {
padding: 0.75rem 1rem;
background: #667eea;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.search-bar button:hover {
background: #5a6fd8;
}
/* 表格样式 */
.table-container {
background: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
overflow: hidden;
}
.data-table {
width: 100%;
border-collapse: collapse;
}
.data-table th,
.data-table td {
padding: 1rem;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
.data-table th {
background: #f8f9fa;
font-weight: 600;
color: #2c3e50;
}
.data-table tr:hover {
background: #f8f9fa;
}
/* 图表容器样式 */
.chart-container {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
height: 500px;
}
.chart-controls {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
}
.chart-controls select {
padding: 0.5rem;
border: 2px solid #e0e0e0;
border-radius: 5px;
font-size: 1rem;
}
/* 财务数据表格样式 */
.financial-table-container {
background: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
overflow: hidden;
}
.financial-table {
width: 100%;
border-collapse: collapse;
}
.financial-table th,
.financial-table td {
padding: 1rem;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
.financial-table th {
background: #f8f9fa;
font-weight: 600;
}
/* 日志容器样式 */
.log-container {
background: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
max-height: 600px;
overflow-y: auto;
}
.log-list {
padding: 1rem;
}
.log-item {
padding: 1rem;
border-left: 4px solid #667eea;
margin-bottom: 1rem;
background: #f8f9fa;
border-radius: 5px;
}
.log-item.error {
border-left-color: #e74c3c;
background: #fdf2f2;
}
.log-item.warning {
border-left-color: #f39c12;
background: #fef9e7;
}
.log-item.info {
border-left-color: #3498db;
background: #f0f8ff;
}
.log-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.log-level {
padding: 0.25rem 0.5rem;
border-radius: 3px;
font-size: 0.8rem;
font-weight: 600;
}
.log-level.info {
background: #3498db;
color: white;
}
.log-level.warning {
background: #f39c12;
color: white;
}
.log-level.error {
background: #e74c3c;
color: white;
}
.log-time {
color: #7f8c8d;
font-size: 0.9rem;
}
.log-message {
color: #2c3e50;
margin-bottom: 0.5rem;
}
.log-details {
color: #7f8c8d;
font-size: 0.9rem;
}
/* 分页样式 */
.pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 0.5rem;
margin-top: 2rem;
}
.pagination button {
padding: 0.5rem 1rem;
border: 1px solid #e0e0e0;
background: white;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.pagination button:hover {
background: #f8f9fa;
}
.pagination button.active {
background: #667eea;
color: white;
border-color: #667eea;
}
/* 加载遮罩样式 */
.loading-overlay {
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: 2000;
}
.loading-overlay.show {
display: flex;
}
.loading-spinner {
background: white;
padding: 2rem;
border-radius: 10px;
text-align: center;
}
.loading-spinner i {
font-size: 2rem;
color: #667eea;
margin-bottom: 1rem;
}
/* 响应式设计 */
@media (max-width: 768px) {
.nav-container {
flex-direction: column;
gap: 1rem;
}
.nav-menu {
gap: 1rem;
}
.stats-grid {
grid-template-columns: 1fr;
}
.chart-container {
height: 300px;
}
.search-bar {
flex-direction: column;
}
}
/* 按钮样式 */
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
transition: background-color 0.3s;
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #5a6fd8;
}
.btn-secondary {
background: #95a5a6;
color: white;
}
.btn-secondary:hover {
background: #7f8c8d;
}
/* 控制面板样式 */
.control-panel {
display: flex;
gap: 1rem;
margin-bottom: 2rem;
flex-wrap: wrap;
}
.control-panel select,
.control-panel input {
padding: 0.5rem;
border: 2px solid #e0e0e0;
border-radius: 5px;
font-size: 1rem;
}
.control-panel button {
padding: 0.5rem 1rem;
background: #667eea;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.control-panel button:hover {
background: #5a6fd8;
}
/* 股票详情模态框样式 */
.modal-overlay {
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: 3000;
}
.modal-overlay.show {
display: flex;
}
.modal-content {
background: white;
border-radius: 10px;
padding: 2rem;
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
border-bottom: 1px solid #e0e0e0;
padding-bottom: 1rem;
}
.modal-title {
font-size: 1.5rem;
font-weight: 600;
color: #2c3e50;
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #7f8c8d;
}
.modal-close:hover {
color: #e74c3c;
}
/* 错误提示样式 */
.error-message {
background: #fdf2f2;
border: 1px solid #e74c3c;
color: #e74c3c;
padding: 1rem;
border-radius: 5px;
margin-bottom: 1rem;
}
.success-message {
background: #f0fff4;
border: 1px solid #38a169;
color: #38a169;
padding: 1rem;
border-radius: 5px;
margin-bottom: 1rem;
}
/* 空状态样式 */
.empty-state {
text-align: center;
padding: 3rem;
color: #7f8c8d;
}
.empty-state i {
font-size: 3rem;
margin-bottom: 1rem;
color: #bdc3c7;
}
/* 动画效果 */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.content-section.active {
animation: fadeIn 0.5s ease-out;
}
/* 滚动条样式 */
.log-container::-webkit-scrollbar {
width: 8px;
}
.log-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
.log-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
}
.log-container::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
/* 股票详情模态框样式 */
.modal-body {
max-height: 60vh;
overflow-y: auto;
}
.stock-basic-info,
.stock-price-info,
.stock-chart {
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid #e0e0e0;
}
.stock-basic-info h3,
.stock-price-info h3,
.stock-chart h3 {
font-size: 1.2rem;
color: #2c3e50;
margin-bottom: 1rem;
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.info-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem;
background: #f8f9fa;
border-radius: 5px;
}
.info-item label {
font-weight: 600;
color: #7f8c8d;
}
.info-item span {
color: #2c3e50;
}
.price-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
}
.price-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 1rem;
background: #f8f9fa;
border-radius: 5px;
}
.price-item label {
font-size: 0.9rem;
color: #7f8c8d;
margin-bottom: 0.5rem;
}
.price-item .price {
font-size: 1.5rem;
font-weight: 600;
color: #2c3e50;
}
/* 智能分页样式 */
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin: 2rem 0;
flex-wrap: wrap;
}
.pagination button {
padding: 0.5rem 1rem;
border: 1px solid #ddd;
background: white;
color: #333;
cursor: pointer;
border-radius: 4px;
transition: all 0.3s;
min-width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.pagination button:hover:not(.active):not(.ellipsis) {
background: #f5f5f5;
border-color: #667eea;
}
.pagination button.active {
background: #667eea;
color: white;
border-color: #667eea;
}
.pagination button.ellipsis {
background: transparent;
border: none;
cursor: default;
color: #999;
min-width: auto;
}
.pagination button.ellipsis:hover {
background: transparent;
}
/* 页面跳转样式 */
.page-jump {
display: flex;
align-items: center;
gap: 0.5rem;
margin-left: 1rem;
}
.page-jump input {
width: 80px;
padding: 0.5rem;
border: 1px solid #ddd;
border-radius: 4px;
text-align: center;
}
.page-jump input:focus {
outline: none;
border-color: #667eea;
}
.page-jump button {
padding: 0.5rem 1rem;
background: #667eea;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
.page-jump button:hover {
background: #5a6fd8;
}
/* 响应式分页 */
@media (max-width: 768px) {
.pagination {
gap: 0.25rem;
}
.pagination button {
padding: 0.25rem 0.5rem;
min-width: 35px;
height: 35px;
font-size: 0.9rem;
}
.page-jump {
margin-left: 0.5rem;
flex-direction: column;
gap: 0.25rem;
}
.page-jump input {
width: 60px;
font-size: 0.9rem;
}
.page-jump button {
padding: 0.25rem 0.5rem;
font-size: 0.9rem;
}
}
@media (max-width: 480px) {
.pagination {
flex-direction: column;
gap: 0.5rem;
}
.page-jump {
margin-left: 0;
flex-direction: row;
justify-content: center;
}
}
.price-item .change {
font-size: 1.2rem;
font-weight: 600;
}
.mini-chart-container {
height: 200px;
margin-top: 1rem;
}
/* 响应式设计增强 */
@media (max-width: 480px) {
.modal-content {
margin: 1rem;
padding: 1rem;
}
.info-grid {
grid-template-columns: 1fr;
}
.price-grid {
grid-template-columns: 1fr;
}
.mini-chart-container {
height: 150px;
}
}