Files
001code-html--cocos/scratch-gui/static/css/leaderboard.css
刘宇飞 6e0a1fbcbb Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 15:37:45 +08:00

1030 lines
20 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* === 基本样式重置与通用设置 === */
:root {
--primary-color: #4a6bdf;
--secondary-color: #fd7e14;
--accent-color: #17a2b8;
--background-color: #f8f9fa;
--text-color: #343a40;
--light-text: #6c757d;
--header-bg: linear-gradient(135deg, #4a6bdf 0%, #2546c5 100%);
--footer-bg: #343a40;
--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
--border-radius: 0.5rem;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body.leaderboard-page {
font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
color: var(--text-color);
background-color: var(--background-color);
line-height: 1.6;
min-height: 100vh;
display: flex;
flex-direction: column;
}
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* === 动画定义 === */
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* === 头部样式 === */
.header {
background: var(--header-bg);
padding: 1.5rem 0;
color: white;
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 100;
animation: fadeIn 0.5s ease;
}
.logo-container {
display: flex;
align-items: center;
gap: 1rem;
}
.logo {
height: 55px;
width: auto;
}
.competition-name {
font-size: 1.5rem;
font-weight: 600;
margin: 0;
flex-grow: 1;
}
.header-info {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 0.8rem;
flex-wrap: nowrap;
}
.display-mode-controls {
display: flex;
align-items: center;
gap: 0.8rem;
flex-wrap: nowrap;
}
#fullscreen-btn {
border-radius: 20px;
padding: 0.5rem 1rem;
font-weight: 500;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
height: 38px;
display: inline-flex;
align-items: center;
white-space: nowrap;
}
.auto-refresh {
height: 38px;
display: inline-flex;
align-items: center;
white-space: nowrap;
}
.form-check-input {
cursor: pointer;
}
.form-check-label {
font-size: 0.9rem;
cursor: pointer;
white-space: nowrap;
margin: 0;
padding-left: 0.5rem;
}
/* 选择器行 */
.selectors-row {
display: flex;
align-items: center;
gap: 0.8rem;
flex-wrap: nowrap;
}
.codetype-selector,
.pagesize-selector,
.progress-type-selector,
.age-group-selector {
margin-left: 0;
}
.codetype-selector select,
.pagesize-selector select,
.age-group-selector select,
#fullscreen-btn,
.auto-refresh {
height: 38px;
display: flex;
align-items: center;
}
.codetype-selector select,
.pagesize-selector select {
min-width: 100px;
width: auto;
}
.progress-type-selector .btn-group {
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
border-radius: 20px;
overflow: hidden;
flex-shrink: 0;
height: 38px;
border: 1px solid var(--primary-color);
}
.progress-type-selector .btn {
height: 100%;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.5rem 1rem;
white-space: nowrap;
font-weight: 500;
border: none;
color: var(--primary-color);
}
.progress-type-selector .btn.active {
background-color: var(--primary-color);
color: white;
}
.progress-type-selector .btn:not(.active) {
background-color: transparent;
}
.progress-type-selector .btn:hover:not(.active) {
background-color: rgba(74, 107, 223, 0.1);
}
/* 当有背景图时的样式调整 */
body.with-custom-background .progress-type-selector .btn-group {
border: 1px solid rgba(255, 255, 255, 0.5);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
body.with-custom-background .progress-type-selector .btn {
color: rgba(255, 255, 255, 0.9);
}
body.with-custom-background .progress-type-selector .btn.active {
background-color: rgba(74, 107, 223, 0.8);
color: white;
}
body.with-custom-background .progress-type-selector .btn:not(.active) {
background-color: transparent;
}
body.with-custom-background .progress-type-selector .btn:hover:not(.active) {
background-color: rgba(255, 255, 255, 0.1);
}
.codetype-selector select:focus,
.pagesize-selector select:focus {
box-shadow: 0 0 0 3px rgba(74, 107, 223, 0.25);
outline: none;
}
.codetype-selector select,
.pagesize-selector select {
border-radius: 20px;
border: none;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
padding: 0.5rem 1rem;
font-weight: 500;
width: auto;
min-width: 110px;
transition: all 0.3s ease;
height: 38px;
display: flex;
align-items: center;
white-space: nowrap;
}
/* 大屏模式样式 */
body.fullscreen-mode {
overflow: hidden;
}
body.fullscreen-mode .header {
padding: 0.5rem 0;
}
body.fullscreen-mode .logo {
height: 40px;
}
body.fullscreen-mode .main-content {
padding: 0.5rem 0;
}
body.fullscreen-mode .leaderboard-table {
font-size: 1.2rem;
}
body.fullscreen-mode .rank-badge {
width: 45px;
height: 45px;
font-size: 1.2rem;
}
body.fullscreen-mode .section-title {
font-size: 1.8rem;
}
body.fullscreen-mode .footer {
display: none;
}
/* === 主要内容区域 === */
.main-content {
flex: 1;
padding: 2rem 0;
animation: fadeIn 0.8s ease;
}
.leaderboard-header {
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.section-title {
display: flex;
align-items: center;
font-size: 1.5rem;
color: var(--primary-color);
margin-bottom: 0;
}
.section-title i {
margin-right: 0.5rem;
color: var(--secondary-color);
}
.leaderboard-info {
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
gap: 1rem;
}
.info-item {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--light-text);
font-size: 0.9rem;
}
.info-item i {
color: var(--primary-color);
}
/* === 排行榜表格 === */
.leaderboard-table-container {
background-color: white;
border-radius: var(--border-radius);
box-shadow: var(--card-shadow);
overflow: hidden;
margin-bottom: 1.5rem;
animation: slideUp 0.5s ease;
}
.leaderboard-table {
width: 100%;
margin-bottom: 0;
}
.leaderboard-table th {
background-color: #f3f5f9;
border-bottom: 2px solid #e9ecef;
color: var(--primary-color);
font-weight: 600;
padding: 1rem;
}
.leaderboard-table tbody tr {
transition: all 0.3s ease;
}
.leaderboard-table tbody tr:hover {
transform: scale(1.02);
z-index: 1;
}
.leaderboard-table td {
padding: 1rem;
vertical-align: middle;
border-bottom: 1px solid #e9ecef;
}
.rank-cell {
width: 70px;
}
.rank-badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: 50%;
font-weight: bold;
color: white;
background-color: #6c757d;
}
.rank-1 {
background: linear-gradient(45deg, #FFD700, #FFA500);
box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.rank-2 {
background: linear-gradient(45deg, #C0C0C0, #A9A9A9);
box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}
.rank-3 {
background: linear-gradient(45deg, #CD7F32, #A0522D);
box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}
.rank-normal {
background-color: #6c757d;
}
.participant-cell {
min-width: 150px;
}
.participant-info {
display: flex;
flex-direction: column;
}
.participant-username {
font-weight: 600;
color: var(--primary-color);
font-size: 0.85rem;
}
.participant-fullname {
font-weight: 600;
color: var(--primary-color);
}
.loading-spinner {
display: flex;
flex-direction: column;
align-items: center;
padding: 2rem;
gap: 1rem;
}
.loading-text {
color: var(--light-text);
font-size: 0.9rem;
}
.no-data {
padding: 3rem 0;
text-align: center;
color: var(--light-text);
}
.no-data i {
font-size: 3rem;
margin-bottom: 1rem;
color: #dee2e6;
}
.no-data p {
font-size: 1.1rem;
margin-bottom: 0;
}
.empty-message {
padding: 2rem;
}
/* === 分页控件 === */
.pagination-container {
margin: 1.5rem 0;
display: flex;
justify-content: center;
}
.pagination .page-link {
color: var(--primary-color);
border-color: #dee2e6;
transition: all 0.2s ease;
}
.pagination .page-item.active .page-link {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.pagination .page-link:hover {
z-index: 2;
color: white;
background-color: var(--primary-color);
border-color: var(--primary-color);
}
/* === 底部样式 === */
.footer {
background-color: var(--footer-bg);
color: #f8f9fa;
padding: 1.5rem 0;
margin-top: auto;
text-align: center;
}
.copyright {
margin-bottom: 0;
font-size: 0.9rem;
text-align: center;
width: 100%;
}
.footer .row {
justify-content: center;
}
.footer-links {
display: flex;
justify-content: flex-end;
gap: 1.5rem;
}
.footer-link {
color: rgba(255, 255, 255, 0.7);
text-decoration: none;
font-size: 0.9rem;
transition: color 0.2s ease;
}
.footer-link:hover {
color: white;
text-decoration: none;
}
/* === 模态框样式 === */
.modal-content {
border-radius: var(--border-radius);
box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
border: none;
}
.modal-header {
background-color: var(--primary-color);
color: white;
border-bottom: none;
border-top-left-radius: calc(var(--border-radius) - 1px);
border-top-right-radius: calc(var(--border-radius) - 1px);
}
.modal-footer {
border-top: 1px solid #e9ecef;
}
/* === 响应式设计 === */
@media (max-width: 768px) {
.header {
padding: 1rem 0;
}
.logo {
height: 45px;
}
.competition-name {
font-size: 1.2rem;
}
.header-info {
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-end;
gap: 0.5rem;
}
.selectors-row {
display: flex;
width: auto;
gap: 8px;
margin-bottom: 0;
}
.display-mode-controls,
.codetype-selector,
.pagesize-selector,
.progress-type-selector {
margin: 0;
}
.codetype-selector select,
.pagesize-selector select {
min-width: 90px;
width: auto;
padding: 0.4rem 0.8rem;
}
.progress-type-selector .btn {
padding: 0.4rem 0.8rem;
font-size: 0.9rem;
}
.leaderboard-header .row {
flex-direction: column;
}
.leaderboard-info {
justify-content: flex-start;
margin-top: 1rem;
}
.section-title {
font-size: 1.3rem;
}
.leaderboard-table th,
.leaderboard-table td {
padding: 0.75rem;
}
}
@media (max-width: 576px) {
.container {
padding-left: 10px;
padding-right: 10px;
}
.logo-container {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.header-info {
margin-top: 1rem;
width: 100%;
flex-direction: column;
align-items: center;
}
.display-mode-controls {
display: none;
}
.selectors-row {
display: flex;
width: 100%;
gap: 6px;
margin-bottom: 0.5rem;
flex-wrap: nowrap;
}
.codetype-selector,
.pagesize-selector {
flex-shrink: 1;
position: relative;
}
.progress-type-selector {
flex-shrink: 0;
}
.codetype-selector select,
.pagesize-selector select,
.age-group-selector select {
width: 100%;
min-width: 0;
font-size: 0.85rem;
padding: 0.5rem;
border-radius: 8px;
background-color: rgba(255, 255, 255, 0.9);
border: none;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234a6bdf' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: calc(100% - 8px) center;
background-size: 12px;
padding-right: 28px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
}
.progress-type-selector .btn-group {
width: auto;
display: flex;
}
.progress-type-selector .btn {
padding: 0.5rem 0.6rem;
font-size: 0.8rem;
white-space: nowrap;
}
.leaderboard-table th,
.leaderboard-table td {
padding: 0.5rem 0.3rem;
font-size: 0.85rem;
}
.participant-username,
.participant-fullname {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
.rank-badge {
width: 30px;
height: 30px;
font-size: 0.85rem;
}
.rank-cell {
width: 40px;
}
.pagination .page-link {
padding: 0.3rem 0.6rem;
}
.footer .row {
flex-direction: column;
text-align: center;
gap: 1rem;
}
.footer-links {
justify-content: center;
}
}
/* iPhone特定优化 */
@media only screen
and (max-width: 428px) {
.header {
padding: 0.8rem 0;
}
.container {
padding-left: 8px;
padding-right: 8px;
}
.main-content {
padding: 1rem 0;
}
/* iPhone选择器优化 */
.selectors-row {
gap: 4px;
}
.codetype-selector select,
.pagesize-selector select,
.age-group-selector select {
font-size: 0.8rem;
padding: 0.45rem 0.4rem;
padding-right: 18px;
background-size: 10px;
background-position: calc(100% - 4px) center;
border-radius: 6px;
min-width: 85px;
width: auto;
}
.progress-type-selector .btn {
padding: 0.45rem 0.4rem;
font-size: 0.75rem;
}
.leaderboard-table th,
.leaderboard-table td {
padding: 0.4rem 0.2rem;
font-size: 0.8rem;
}
.leaderboard-table-container {
margin-bottom: 1rem;
}
.rank-badge {
width: 26px;
height: 26px;
font-size: 0.8rem;
}
.section-title {
font-size: 1.1rem;
}
.leaderboard-info .info-item {
font-size: 0.8rem;
}
/* 调整安全区域 */
.footer {
padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
/* 横屏时的特殊处理 */
@media (orientation: landscape) {
.header-info {
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.selectors-row {
width: auto;
margin: 0 0.25rem 0.5rem 0.25rem;
}
}
}
/* === 打印样式 === */
@media print {
.header {
box-shadow: none;
color: var(--text-color);
background: none;
padding: 1rem 0;
}
.competition-name {
color: var(--text-color);
}
.codetype-selector,
.pagesize-selector,
.progress-type-selector,
.pagination-container,
.footer {
display: none;
}
.leaderboard-table-container {
box-shadow: none;
}
.leaderboard-table th {
background-color: white;
color: var(--text-color);
border-bottom: 2pt solid #ddd;
}
.rank-badge {
color: var(--text-color);
background: none !important;
box-shadow: none !important;
border: 1pt solid #ddd;
}
}
/* === 访问被拒绝样式 === */
.access-denied-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--background-color);
z-index: 1000;
}
.access-denied-message {
text-align: center;
background-color: white;
padding: 2rem;
border-radius: var(--border-radius);
box-shadow: var(--card-shadow);
max-width: 90%;
width: 450px;
animation: slideUp 0.5s ease;
}
.access-denied-message i {
font-size: 3rem;
color: var(--secondary-color);
margin-bottom: 1rem;
}
.access-denied-message h2 {
color: var(--text-color);
margin-bottom: 1rem;
font-size: 1.5rem;
}
.access-denied-message p {
color: var(--light-text);
margin-bottom: 1.5rem;
line-height: 1.5;
}
/* 自定义背景图片样式 */
body.with-custom-background {
position: relative;
}
body.with-custom-background::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
body.with-custom-background .header {
background: rgba(52, 58, 64, 0.5);
backdrop-filter: blur(5px);
box-shadow: none;
}
body.with-custom-background .main-content {
position: relative;
}
body.with-custom-background .leaderboard-table-container {
background-color: transparent;
box-shadow: none;
}
body.with-custom-background .leaderboard-header {
background-color: transparent;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
body.with-custom-background .section-title {
color: white;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
body.with-custom-background .info-item {
color: rgba(255, 255, 255, 0.8);
}
body.with-custom-background .info-item i {
color: rgba(255, 255, 255, 0.9);
}
body.with-custom-background .leaderboard-table th {
background-color: rgba(255, 255, 255, 0.2);
color: white;
border-bottom: none;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
body.with-custom-background .leaderboard-table td {
background-color: rgba(255, 255, 255, 0.1);
color: white;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
body.with-custom-background .leaderboard-table tr:nth-child(even) td {
background-color: rgba(255, 255, 255, 0.15);
}
body.with-custom-background .leaderboard-table tbody tr:hover td {
background-color: transparent;
transform: scale(1.02);
transition: all 0.3s ease;
cursor: pointer;
}
body.with-custom-background .leaderboard-table tbody tr td {
transition: all 0.3s ease;
background-color: rgba(255, 255, 255, 0.1);
}
body.with-custom-background .participant-username,
body.with-custom-background .participant-fullname {
color: white;
}
body.with-custom-background .pagination .page-link {
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.1);
color: white;
}
body.with-custom-background .pagination .page-item.active .page-link {
background-color: rgba(74, 107, 223, 0.8);
border-color: rgba(74, 107, 223, 0.5);
}
body.with-custom-background .pagination .page-link:hover {
background-color: rgba(74, 107, 223, 0.6);
}
body.with-custom-background .footer {
background-color: rgba(52, 58, 64, 0.5);
backdrop-filter: blur(5px);
}
/* === 年龄组别徽章样式 === */
.age-group-badge {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 12px;
font-weight: 500;
text-transform: none;
letter-spacing: 0.5px;
}
.age-group-badge.bg-info {
background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
color: white;
border: 1px solid rgba(255, 255, 255, 0.2);
}
/* 年龄组别选择器响应式样式 */
.age-group-selector select {
min-width: 120px;
width: auto;
}
@media (max-width: 768px) {
.age-group-selector {
margin: 0;
}
.age-group-selector select {
min-width: 110px;
width: auto;
padding: 0.4rem 0.8rem;
}
}
@media (max-width: 576px) {
.age-group-selector {
order: 3;
}
.age-group-selector select {
min-width: 90px;
width: auto;
font-size: 0.8rem;
}
}
/* === 年龄组别表头强制隐藏 === */
/* 确保当添加d-none类时能够强制隐藏即使有内联样式 */
.leaderboard-table #age-group-header.d-none {
display: none !important;
}