Toolhub / wwwroot /css /toolhub.css
unifare
Initial commit: ToolHub ASP.NET Core app
5fc700d
/* ToolHub 现代化样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
/* CSS变量定义 */
:root {
--primary: #165DFF;
--secondary: #36CFC9;
--accent: #FF7D00;
--success: #52C41A;
--warning: #FAAD14;
--danger: #FF4D4F;
--dark: #1D2129;
--dark-2: #4E5969;
--light-1: #F2F3F5;
--light-2: #E5E6EB;
--light-3: #C9CDD4;
--border-radius: 12px;
--border-radius-lg: 20px;
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
--shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
--transition: all 0.3s ease;
--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}
/* 基础样式重置 */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-family);
font-size: 14px;
line-height: 1.6;
color: var(--dark);
background-color: #fafafa;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* 工具样式类 */
.text-gradient {
background: linear-gradient(135deg, var(--primary), var(--secondary));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.bg-blur {
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
display: none;
}
/* 导航栏样式 */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(8px);
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
transition: var(--transition);
padding: 0.75rem 0;
}
.navbar.scrolled {
background: rgba(255, 255, 255, 0.95);
box-shadow: var(--shadow-sm);
}
.navbar-brand {
font-size: 1.5rem;
font-weight: 700;
color: var(--primary);
text-decoration: none;
display: flex;
align-items: center;
gap: 0.5rem;
}
.navbar-brand:hover {
color: var(--primary);
text-decoration: none;
}
.brand-icon {
width: 2.5rem;
height: 2.5rem;
background: linear-gradient(135deg, var(--primary), var(--secondary));
border-radius: var(--border-radius);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.2rem;
}
/* 搜索框样式 */
.search-container {
position: relative;
max-width: 400px;
margin: 0 auto;
}
.search-input {
width: 100%;
padding: 0.75rem 1rem 0.75rem 2.5rem;
border: 1px solid var(--light-2);
border-radius: 50px;
background: var(--light-1);
font-size: 0.875rem;
transition: var(--transition);
}
.search-input:focus {
outline: none;
border-color: var(--primary);
background: white;
box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}
.search-icon {
position: absolute;
left: 0.875rem;
top: 50%;
transform: translateY(-50%);
color: var(--dark-2);
font-size: 0.875rem;
}
/* 按钮样式 */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 50px;
font-weight: 500;
font-size: 0.875rem;
text-decoration: none;
cursor: pointer;
transition: var(--transition);
white-space: nowrap;
gap: 0.5rem;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary), var(--secondary));
color: white;
box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: var(--shadow);
color: white;
text-decoration: none;
}
.btn-outline {
background: white;
color: var(--dark-2);
border: 1px solid var(--light-2);
}
.btn-outline:hover {
background: var(--light-1);
color: var(--dark);
text-decoration: none;
}
.btn-sm {
padding: 0.5rem 1rem;
font-size: 0.8rem;
}
/* 卡片样式 */
.card {
background: white;
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-sm);
overflow: hidden;
transition: var(--transition);
}
.card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
}
.card-img {
width: 100%;
height: 160px;
object-fit: cover;
border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.card-body {
padding: 1.25rem;
}
.card-title {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--dark);
}
.card-text {
color: var(--dark-2);
font-size: 0.875rem;
line-height: 1.5;
margin-bottom: 1rem;
}
.card-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 0.75rem;
border-top: 1px solid var(--light-2);
}
/* 工具卡片样式 */
.tool-card {
position: relative;
overflow: hidden;
}
.tool-card .card-img {
transition: transform 0.5s ease;
}
.tool-card:hover .card-img {
transform: scale(1.1);
}
.tool-badge {
position: absolute;
top: 0.75rem;
right: 0.75rem;
padding: 0.25rem 0.75rem;
border-radius: 50px;
font-size: 0.75rem;
font-weight: 500;
color: white;
}
.tool-badge.hot {
background: var(--danger);
}
.tool-badge.new {
background: var(--accent);
}
.tool-badge.recommended {
background: var(--success);
}
.tool-stats {
display: flex;
align-items: center;
gap: 1rem;
font-size: 0.8rem;
color: var(--dark-2);
}
.tool-rating {
display: flex;
align-items: center;
gap: 0.25rem;
}
.rating-stars {
color: var(--warning);
}
/* 分类标签样式 */
.category-tabs {
display: flex;
gap: 0.5rem;
overflow-x: auto;
padding: 0.5rem 0;
margin-bottom: 2rem;
}
.category-tab {
padding: 0.5rem 1.25rem;
border-radius: 50px;
background: white;
color: var(--dark-2);
text-decoration: none;
white-space: nowrap;
border: 1px solid var(--light-2);
transition: var(--transition);
font-size: 0.875rem;
font-weight: 500;
}
.category-tab:hover,
.category-tab.active {
background: var(--primary);
color: white;
border-color: var(--primary);
text-decoration: none;
}
/* 英雄区域样式 */
.hero {
background: linear-gradient(135deg, rgba(22, 93, 255, 0.05), rgba(54, 207, 201, 0.05));
border-radius: var(--border-radius-lg);
padding: 3rem 2rem;
margin: 2rem 0;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: -50%;
right: -10%;
width: 400px;
height: 400px;
background: radial-gradient(circle, rgba(22, 93, 255, 0.1), transparent);
border-radius: 50%;
}
.hero::after {
content: '';
position: absolute;
bottom: -50%;
left: -10%;
width: 500px;
height: 500px;
background: radial-gradient(circle, rgba(54, 207, 201, 0.1), transparent);
border-radius: 50%;
}
.hero-content {
position: relative;
z-index: 2;
max-width: 600px;
}
.hero-title {
font-size: clamp(2rem, 5vw, 3rem);
font-weight: 700;
line-height: 1.2;
margin-bottom: 1rem;
}
.hero-description {
font-size: 1.1rem;
color: var(--dark-2);
margin-bottom: 2rem;
line-height: 1.6;
}
.hero-stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 2rem;
margin-top: 2rem;
padding-top: 2rem;
border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.hero-stat {
text-align: center;
}
.hero-stat-number {
font-size: 1.75rem;
font-weight: 700;
color: var(--primary);
display: block;
}
.hero-stat-label {
font-size: 0.875rem;
color: var(--dark-2);
margin-top: 0.25rem;
}
/* 快速入口样式 */
.quick-tools {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
margin: 1.5rem 0;
}
.quick-tool {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem 1.25rem;
background: white;
border: 1px solid var(--light-2);
border-radius: 50px;
text-decoration: none;
color: var(--dark);
font-size: 0.875rem;
font-weight: 500;
transition: var(--transition);
box-shadow: var(--shadow-sm);
}
.quick-tool:hover {
transform: translateY(-2px);
box-shadow: var(--shadow);
color: var(--dark);
text-decoration: none;
}
/* 网格布局 */
.grid {
display: grid;
gap: 1.5rem;
}
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 768px) {
.md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
.lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}
/* 响应式工具类 */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
}
@media (min-width: 768px) {
.container {
padding: 0 2rem;
}
}
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pt-20 { padding-top: 5rem; }
.pb-16 { padding-bottom: 4rem; }
/* 页脚样式 */
.footer {
background: var(--dark);
color: var(--light-3);
padding: 4rem 0 2rem;
margin-top: 4rem;
}
.footer-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-bottom: 2rem;
}
.footer-section h4 {
color: white;
font-weight: 600;
margin-bottom: 1rem;
}
.footer-section ul {
list-style: none;
}
.footer-section ul li {
margin-bottom: 0.5rem;
}
.footer-section ul li a {
color: var(--light-3);
text-decoration: none;
transition: var(--transition);
}
.footer-section ul li a:hover {
color: white;
}
.footer-bottom {
border-top: 1px solid var(--dark-2);
padding-top: 2rem;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
}
.social-links {
display: flex;
gap: 1rem;
}
.social-link {
display: flex;
align-items: center;
justify-content: center;
width: 2.5rem;
height: 2.5rem;
background: var(--dark-2);
color: var(--light-3);
border-radius: 50%;
text-decoration: none;
transition: var(--transition);
}
.social-link:hover {
background: var(--primary);
color: white;
}
/* 返回顶部按钮 */
.back-to-top {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 3rem;
height: 3rem;
background: var(--primary);
color: white;
border: none;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow);
cursor: pointer;
transition: var(--transition);
opacity: 0;
visibility: hidden;
z-index: 1000;
}
.back-to-top.visible {
opacity: 1;
visibility: visible;
}
.back-to-top:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}
/* 动画 */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in-up {
animation: fadeInUp 0.5s ease-out;
}
/* 移动端优化 */
@media (max-width: 767px) {
.hero {
padding: 2rem 1rem;
}
.hero-title {
font-size: 1.75rem;
}
.quick-tools {
justify-content: center;
}
.category-tabs {
justify-content: flex-start;
}
.footer-bottom {
flex-direction: column;
text-align: center;
}
}
/* 加载状态 */
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: white;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* 工具提示 */
.tooltip {
position: relative;
cursor: help;
}
.tooltip::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: var(--dark);
color: white;
padding: 0.5rem;
border-radius: var(--border-radius);
font-size: 0.75rem;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: var(--transition);
z-index: 1000;
}
.tooltip:hover::after {
opacity: 1;
visibility: visible;
}
/* 模态框样式 */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
box-sizing: border-box;
}
.modal-backdrop {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
cursor: pointer;
}
.modal-content {
position: relative;
background: white;
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-lg);
width: 100%;
max-width: 600px;
max-height: 90vh;
overflow: hidden;
animation: modalSlideIn 0.3s ease-out;
z-index: 2001;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem;
border-bottom: 1px solid var(--light-2);
}
.modal-header h3 {
margin: 0;
font-size: 1.25rem;
font-weight: 600;
color: var(--dark);
}
.modal-header button {
color: var(--dark-2);
font-size: 1.5rem;
line-height: 1;
cursor: pointer;
transition: var(--transition);
}
.modal-header button:hover {
color: var(--dark);
}
.modal-body {
padding: 1.5rem;
max-height: calc(90vh - 180px);
overflow-y: auto;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
padding: 1.5rem;
border-top: 1px solid var(--light-2);
background: var(--light-1);
}
/* 表单组样式 */
.form-group {
margin-bottom: 1rem;
}
.form-group label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--dark);
font-size: 0.875rem;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 0.75rem;
border: 1px solid var(--light-2);
border-radius: var(--border-radius);
font-size: 0.875rem;
transition: var(--transition);
box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}
.form-group input[type="checkbox"] {
width: auto;
margin-right: 0.5rem;
}
.form-group textarea {
resize: vertical;
min-height: 80px;
}
/* 模态框动画 */
@keyframes modalSlideIn {
from {
opacity: 0;
transform: translateY(-20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* Toast 提示样式 */
.toast {
position: fixed;
top: 2rem;
right: 2rem;
background: white;
border-radius: var(--border-radius);
box-shadow: var(--shadow-lg);
padding: 1rem 1.5rem;
z-index: 3000;
transform: translateX(100%);
opacity: 0;
transition: all 0.3s ease;
max-width: 400px;
border-left: 4px solid var(--primary);
}
.toast.show {
transform: translateX(0);
opacity: 1;
}
.toast-content {
display: flex;
align-items: center;
gap: 0.75rem;
}
.toast-content i {
font-size: 1.2rem;
}
.toast-success {
border-left-color: var(--success);
}
.toast-success .toast-content i {
color: var(--success);
}
.toast-error {
border-left-color: var(--danger);
}
.toast-error .toast-content i {
color: var(--danger);
}
.toast-warning {
border-left-color: var(--warning);
}
.toast-warning .toast-content i {
color: var(--warning);
}
.toast-info {
border-left-color: var(--primary);
}
.toast-info .toast-content i {
color: var(--primary);
}
/* 响应式调整 */
@media (max-width: 768px) {
.modal {
padding: 0.5rem;
}
.modal-content {
max-width: 100%;
max-height: 95vh;
}
.modal-header,
.modal-body,
.modal-footer {
padding: 1rem;
}
.modal-footer {
flex-direction: column-reverse;
}
.modal-footer .btn {
width: 100%;
justify-content: center;
}
.toast {
top: 1rem;
right: 1rem;
left: 1rem;
max-width: none;
}
}