Book_system/app/static/css/statistics.css
2025-05-12 02:42:27 +08:00

857 lines
17 KiB
CSS

/* app/static/css/statistics.css */
:root {
--primary-color: #f8c4d4;
--secondary-color: #fde9f1;
--accent-color: #e684ae;
--text-color: #7a4b56;
--light-text: #a67b84;
--border-color: #f3d1dc;
--shadow-color: rgba(244, 188, 204, 0.25);
--hover-color: #f4bccc;
}
body {
background-color: #fff9fb;
color: var(--text-color);
font-family: 'Arial', sans-serif;
}
.statistics-container {
padding: 25px;
max-width: 1200px;
margin: 0 auto;
background-color: white;
border-radius: 15px;
box-shadow: 0 5px 20px var(--shadow-color);
position: relative;
overflow: hidden;
}
.page-title {
color: var(--accent-color);
margin-bottom: 30px;
padding-bottom: 15px;
border-bottom: 2px dotted var(--border-color);
text-align: center;
font-family: 'Ma Shan Zheng', cursive, Arial, sans-serif;
font-size: 2.2em;
letter-spacing: 1px;
}
/* 波浪下划线动画 */
.page-title:after {
content: '';
display: block;
width: 100px;
height: 5px;
margin: 10px auto 0;
background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
background-size: 200% 100%;
border-radius: 5px;
animation: wave 3s infinite linear;
}
@keyframes wave {
0%, 100% { background-position-x: 0%; }
50% { background-position-x: 100%; }
}
.breadcrumb {
margin-bottom: 20px;
font-size: 14px;
color: var(--light-text);
}
.breadcrumb a {
color: var(--accent-color);
text-decoration: none;
transition: all 0.3s ease;
}
.breadcrumb a:hover {
text-decoration: underline;
color: #d06b9c;
}
.breadcrumb .current-page {
color: var(--text-color);
font-weight: 500;
}
/* 原始卡片菜单 */
.stats-menu {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
margin-top: 30px;
}
/* 原始卡片样式 */
.stats-card {
background-color: var(--secondary-color);
border-radius: 12px;
padding: 25px;
box-shadow: 0 4px 12px var(--shadow-color);
transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
text-decoration: none;
color: var(--text-color);
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
border: 1px solid var(--border-color);
}
.stats-card:hover {
transform: translateY(-8px) scale(1.02);
box-shadow: 0 8px 20px var(--shadow-color);
border-color: var(--primary-color);
}
.card-icon {
font-size: 40px;
margin-bottom: 15px;
color: var(--accent-color);
}
.card-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 10px;
}
.card-description {
font-size: 14px;
color: var(--light-text);
}
.filter-section {
margin-bottom: 25px;
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 12px 18px;
border-radius: 10px;
border: 1px dashed var(--border-color);
}
.filter-label {
font-weight: 500;
margin-right: 10px;
color: var(--text-color);
}
.filter-select {
padding: 8px 15px;
border: 1px solid var(--border-color);
border-radius: 8px;
background-color: white;
color: var(--text-color);
font-size: 0.95em;
transition: border-color 0.3s, box-shadow 0.3s;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e684ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
padding-right: 30px;
}
.filter-select:focus {
outline: none;
border-color: var(--accent-color);
box-shadow: 0 0 0 3px rgba(230, 132, 174, 0.25);
}
.ml-20 {
margin-left: 20px;
}
.chart-container {
background-color: white;
border-radius: 12px;
padding: 25px;
box-shadow: 0 4px 15px var(--shadow-color);
margin-bottom: 35px;
position: relative;
height: 400px; /* 添加固定高度 */
border: 1px solid var(--border-color);
overflow: hidden;
}
.chart-container canvas {
max-height: 100%;
z-index: 1;
position: relative;
}
/* 图表装饰元素 */
.chart-decoration {
position: absolute;
width: 60px;
height: 60px;
border-radius: 50%;
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
opacity: 0.6;
z-index: 0;
}
.chart-decoration.left {
top: -15px;
left: -15px;
}
.chart-decoration.right {
bottom: -15px;
right: -15px;
}
.floating {
animation: floating 6s ease-in-out infinite;
}
@keyframes floating {
0% { transform: translate(0, 0) scale(1); }
50% { transform: translate(10px, 10px) scale(1.1); }
100% { transform: translate(0, 0) scale(1); }
}
/* 适配小图表 */
.chart-container.half {
height: auto;
min-height: 400px;
padding-bottom: 40px; /* 增加底部空间 */
}
/* 特别针对分类图表的调整 */
.chart-container.half .chart-wrapper {
height: 340px; /* 增加图表容器高度 */
padding-bottom: 20px; /* 增加底部填充 */
}
/* 确保图表完整显示 */
canvas#category-chart {
max-height: 100%;
margin-bottom: 20px;
padding-bottom: 20px;
position: relative;
}
/* 移除图表装饰元素在分类饼图中的影响 */
.chart-container.half::before,
.chart-container.half::after {
width: 40px;
height: 40px;
opacity: 0.3;
}
/* 调整图例位置,确保其正确显示 */
.chart-container.half .chart-wrapper {
position: relative;
}
.chart-row {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 30px;
}
.half {
flex: 1 1 calc(50% - 10px);
min-width: 300px;
}
.data-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 2px 10px var(--shadow-color);
}
.data-table th, .data-table td {
padding: 14px 18px;
text-align: left;
}
.data-table th {
background-color: var(--primary-color);
font-weight: 600;
color: var(--text-color);
letter-spacing: 0.5px;
}
.data-table tr {
transition: background-color 0.3s;
}
.data-table tr:nth-child(even) {
background-color: var(--secondary-color);
}
.data-table tr:nth-child(odd) {
background-color: white;
}
.data-table tr:hover {
background-color: #fceef3;
}
.loading-row td {
text-align: center;
padding: 30px;
color: var(--light-text);
}
.loading-animation {
display: flex;
align-items: center;
justify-content: center;
}
.loading-animation:before {
content: '📖';
margin-right: 10px;
animation: bookFlip 2s infinite;
display: inline-block;
}
@keyframes bookFlip {
0% { transform: rotateY(0deg); }
50% { transform: rotateY(180deg); }
100% { transform: rotateY(360deg); }
}
.dot-animation {
display: inline-block;
animation: dotAnimation 1.5s infinite;
}
@keyframes dotAnimation {
0% { opacity: 0.3; }
50% { opacity: 1; }
100% { opacity: 0.3; }
}
.stats-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 15px;
margin-bottom: 30px;
}
.stats-card .card-value {
font-size: 28px;
font-weight: 700;
margin-bottom: 5px;
color: var(--accent-color);
}
/* 引用容器 */
.quote-container {
text-align: center;
margin: 40px auto 20px;
max-width: 600px;
font-style: italic;
color: var(--text-color);
padding: 20px;
background-color: var(--secondary-color);
border-radius: 12px;
position: relative;
}
.quote-container:before,
.quote-container:after {
content: """;
font-size: 60px;
font-family: Georgia, serif;
position: absolute;
color: var(--primary-color);
opacity: 0.5;
}
.quote-container:before {
top: -10px;
left: 10px;
}
.quote-container:after {
content: """;
bottom: -30px;
right: 10px;
}
.quote-container p {
position: relative;
z-index: 1;
margin-bottom: 10px;
font-size: 16px;
}
.quote-author {
display: block;
font-size: 14px;
font-style: normal;
text-align: right;
color: var(--light-text);
}
/* 书籍列表标题 */
.book-list-title {
text-align: center;
margin-bottom: 25px;
color: var(--accent-color);
font-family: 'Ma Shan Zheng', cursive, Arial, sans-serif;
font-size: 1.6em;
position: relative;
display: inline-block;
left: 50%;
transform: translateX(-50%);
padding: 0 15px;
}
.book-icon {
font-size: 0.9em;
margin: 0 8px;
opacity: 0.85;
}
.column-icon {
font-size: 0.9em;
margin-right: 5px;
opacity: 0.8;
}
.book-list-title:before,
.book-list-title:after {
content: '';
position: absolute;
height: 2px;
background: linear-gradient(to right, transparent, var(--primary-color), transparent);
width: 80px;
top: 50%;
}
.book-list-title:before {
right: 100%;
margin-right: 15px;
}
.book-list-title:after {
left: 100%;
margin-left: 15px;
}
/* 表格中的图标样式 */
.data-table .borrow-count:after {
content: '📚';
font-size: 12px;
margin-left: 5px;
opacity: 0;
transition: opacity 0.3s ease, transform 0.3s ease;
transform: translateY(5px);
display: inline-block;
}
.data-table tr:hover .borrow-count:after {
opacity: 1;
transform: translateY(0);
}
/* 前三名特殊样式 */
.data-table tr:nth-child(1) .rank:before {
content: '🏆';
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
font-size: 18px;
}
.data-table tr:nth-child(2) .rank:before {
content: '🥈';
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
font-size: 16px;
}
.data-table tr:nth-child(3) .rank:before {
content: '🥉';
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
font-size: 16px;
}
/* 书名悬停效果 */
.book-title {
position: relative;
text-decoration: none;
display: inline-block;
}
.book-title:after {
content: '';
position: absolute;
width: 100%;
height: 2px;
bottom: -2px;
left: 0;
background-color: var(--accent-color);
transform: scaleX(0);
transform-origin: bottom right;
transition: transform 0.3s ease-out;
}
tr:hover .book-title:after {
transform: scaleX(1);
transform-origin: bottom left;
}
/* 数据表格相关样式 */
.data-table img {
width: 55px;
height: 80px;
object-fit: cover;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(0,0,0,0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
border: 2px solid white;
}
.data-table tr:hover img {
transform: scale(1.08);
box-shadow: 0 5px 15px rgba(0,0,0,0.15);
border-color: var(--primary-color);
}
.data-table .rank {
font-weight: 700;
text-align: center;
position: relative;
}
.data-table .book-title {
font-weight: 500;
color: var(--accent-color);
transition: color 0.3s;
}
.data-table tr:hover .book-title {
color: #d06b9c;
}
.data-table .author {
font-style: italic;
color: var(--light-text);
}
.data-table .borrow-count {
font-weight: 600;
color: var(--accent-color);
position: relative;
display: inline-block;
}
.no-data {
text-align: center;
padding: 40px;
color: var(--light-text);
background-color: var(--secondary-color);
border-radius: 12px;
font-style: italic;
border: 1px dashed var(--border-color);
}
/* 书籍行动画 */
#ranking-table-body tr {
transition: transform 0.3s ease, opacity 0.3s ease;
}
#ranking-table-body tr:hover {
transform: translateX(5px);
}
/* 四宫格统计页面样式 */
.quote-banner {
background-color: var(--secondary-color);
border-radius: 10px;
padding: 15px 25px;
margin: 0 auto 30px;
max-width: 80%;
text-align: center;
box-shadow: 0 3px 15px var(--shadow-color);
border-left: 4px solid var(--accent-color);
border-right: 4px solid var(--accent-color);
position: relative;
}
.quote-banner p {
font-style: italic;
color: var(--text-color);
font-size: 16px;
margin: 0;
letter-spacing: 0.5px;
}
.quote-banner:before,
.quote-banner:after {
content: '"';
font-family: Georgia, serif;
font-size: 50px;
color: var(--primary-color);
opacity: 0.5;
position: absolute;
top: -15px;
}
.quote-banner:before {
left: 10px;
}
.quote-banner:after {
right: 10px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 25px;
margin: 20px auto;
max-width: 1000px;
}
/* 四宫格卡片样式 */
.stats-grid .stats-card {
position: relative;
background-color: white;
border-radius: 15px;
overflow: hidden;
box-shadow: 0 5px 20px var(--shadow-color);
transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
text-decoration: none;
color: var(--text-color);
border: 1px solid var(--border-color);
height: 250px;
padding: 0; /* 重置内边距 */
}
.card-inner {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 30px;
height: 100%;
position: relative;
z-index: 2;
background: rgba(255, 255, 255, 0.9);
transition: all 0.3s ease;
}
.stats-grid .stats-card:hover {
transform: translateY(-8px);
}
.stats-grid .stats-card:hover .card-inner {
background: rgba(255, 255, 255, 0.95);
}
.stats-grid .card-icon {
font-size: 40px;
margin-bottom: 20px;
color: var(--accent-color);
background-color: var(--secondary-color);
width: 80px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
box-shadow: 0 4px 10px var(--shadow-color);
transition: transform 0.3s ease;
}
.stats-grid .stats-card:hover .card-icon {
transform: scale(1.1) rotate(5deg);
}
.stats-grid .card-title {
font-size: 20px;
font-weight: 600;
margin-bottom: 15px;
color: var(--accent-color);
position: relative;
display: inline-block;
}
.stats-grid .card-title:after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 100%;
height: 2px;
background-color: var(--primary-color);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}
.stats-grid .stats-card:hover .card-title:after {
transform: scaleX(1);
}
/* 卡片装饰 */
.card-decoration {
position: absolute;
bottom: -30px;
right: -30px;
width: 150px;
height: 150px;
border-radius: 50%;
background-color: var(--primary-color);
opacity: 0.1;
transition: all 0.5s ease;
z-index: 1;
}
.card-decoration.active {
transform: scale(1.5);
opacity: 0.2;
}
/* 特定卡片的独特装饰 */
.book-decoration:before {
content: '📚';
position: absolute;
font-size: 30px;
top: 40px;
left: 40px;
opacity: 0.4;
}
.trend-decoration:before {
content: '📈';
position: absolute;
font-size: 30px;
top: 40px;
left: 40px;
opacity: 0.4;
}
.user-decoration:before {
content: '👥';
position: absolute;
font-size: 30px;
top: 40px;
left: 40px;
opacity: 0.4;
}
.overdue-decoration:before {
content: '⏰';
position: absolute;
font-size: 30px;
top: 40px;
left: 40px;
opacity: 0.4;
}
/* 页面装饰 */
.page-decoration {
position: absolute;
width: 200px;
height: 200px;
border-radius: 50%;
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
opacity: 0.3;
z-index: -1;
}
.page-decoration.left {
top: -100px;
left: -100px;
animation: floatLeft 15s ease-in-out infinite;
}
.page-decoration.right {
bottom: -100px;
right: -100px;
animation: floatRight 17s ease-in-out infinite;
}
@keyframes floatLeft {
0%, 100% { transform: translate(0, 0) rotate(0deg); }
25% { transform: translate(20px, 20px) rotate(5deg); }
50% { transform: translate(10px, 30px) rotate(10deg); }
75% { transform: translate(30px, 10px) rotate(5deg); }
}
@keyframes floatRight {
0%, 100% { transform: translate(0, 0) rotate(0deg); }
25% { transform: translate(-20px, -10px) rotate(-5deg); }
50% { transform: translate(-15px, -25px) rotate(-10deg); }
75% { transform: translate(-25px, -15px) rotate(-5deg); }
}
/* 动画效果 */
.fade-in {
animation: fadeIn 0.5s ease forwards;
opacity: 0;
transform: translateY(10px);
}
@keyframes fadeIn {
to {
opacity: 1;
transform: translateY(0);
}
}
/* 响应式调整 */
@media (max-width: 768px) {
.chart-row {
flex-direction: column;
}
.half {
width: 100%;
}
.stats-cards {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.filter-section {
flex-wrap: wrap;
}
.ml-20 {
margin-left: 0;
margin-top: 10px;
}
.stats-grid {
grid-template-columns: 1fr;
}
.stats-grid .stats-card {
height: 200px;
}
.quote-banner {
max-width: 95%;
padding: 15px;
}
.quote-banner:before,
.quote-banner:after {
font-size: 30px;
}
}