Files
rust-imager/assets/css/album.css
lychang 36969a4fa0 update
2026-07-19 23:56:28 +08:00

803 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-blue: #1e40af;
--secondary-blue: #3b82f6;
--accent-purple: #8b5cf6;
--accent-pink: #ec4899;
--white: #ffffff;
--bg-primary: #f8fafc;
--bg-surface: #ffffff;
--bg-hover: #f1f5f9;
--border-gray: #e5e7eb;
--text-dark: #1e293b;
--text-light: #64748b;
--text-muted: #94a3b8;
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);
--radius: 8px;
--radius-card: 12px;
--radius-lg: 16px;
}
* { box-sizing: border-box; }
body {
font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
background: var(--bg-primary);
min-height: 100vh;
color: var(--text-dark);
line-height: 1.6;
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 24px 20px;
}
/* ============ 顶部返回按钮 ============ */
.back-link {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
background: var(--bg-surface);
color: var(--secondary-blue);
text-decoration: none;
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
margin-bottom: 20px;
transition: all 0.2s ease;
border: 1px solid var(--border-gray);
font-weight: 500;
font-size: 0.9rem;
}
.back-link:hover {
background: var(--bg-hover);
transform: translateX(-3px);
box-shadow: var(--shadow-md);
}
/* ============ 相册标题区 ============ */
.header {
text-align: center;
margin-bottom: 32px;
}
.album-title {
color: var(--text-dark);
font-size: 2rem;
margin-bottom: 12px;
font-weight: 700;
line-height: 1.3;
background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-purple) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
padding: 0 20px;
}
.album-info {
display: inline-flex;
align-items: center;
gap: 6px;
color: #475569;
font-size: 0.85rem;
font-weight: 500;
line-height: 1.2;
padding: 6px 14px;
background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
border-radius: 20px;
border: 1px solid #cbd5e1;
cursor: default;
user-select: none;
height: auto;
min-height: 0;
}
.album-info i { color: #64748b; }
/* 照片数量 + 标签 合并到一行 */
.album-header-row {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 12px 16px;
margin: 12px auto 24px;
max-width: 1100px;
}
.album-header-row .album-info {
margin: 0;
flex: 0 0 auto;
width: auto;
max-width: none;
}
/* ============ 相册标签区(简洁版:与照片数量同行) ============ */
.album-header-row .album-meta-tags {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
gap: 8px;
margin: 0;
max-width: none;
min-width: 0;
}
/* 标签分组 */
.tag-group {
margin-bottom: 14px;
background: var(--bg-surface);
border-radius: var(--radius-card);
border: 1px solid var(--border-gray);
padding: 12px 16px;
transition: all 0.2s ease;
box-shadow: var(--shadow-sm);
}
.tag-group:hover {
box-shadow: var(--shadow-md);
border-color: #cbd5e1;
}
.tag-group-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px dashed var(--border-gray);
font-size: 0.85rem;
font-weight: 600;
color: var(--text-light);
}
.tag-group-header i {
font-size: 0.9rem;
color: var(--secondary-blue);
}
.tag-group-header span {
color: var(--text-light);
}
.tag-group-count {
margin-left: auto;
background: var(--bg-hover);
padding: 2px 8px;
border-radius: 10px;
font-size: 0.75rem;
font-weight: 600;
color: var(--text-muted);
}
.tag-group-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.meta-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 500;
line-height: 1.2;
cursor: pointer;
transition: all 0.2s ease;
user-select: none;
border: 1px solid transparent;
position: relative;
overflow: hidden;
}
.meta-chip::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
transition: left 0.5s ease;
}
.meta-chip:hover::before {
left: 100%;
}
.meta-chip:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.meta-chip:active { transform: translateY(0); }
.meta-chip i { font-size: 0.75rem; opacity: 0.9; }
/* 人物标签 */
.meta-chip-person {
background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(236, 72, 153, 0.12) 100%);
color: var(--accent-purple);
border-color: rgba(139, 92, 246, 0.25);
font-weight: 600;
}
.meta-chip-person:hover {
background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
color: var(--white);
border-color: transparent;
}
/* 分类标签(按类别着色) */
.meta-chip-tag-style {
background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
color: #0284c7;
border-color: #bae6fd;
}
.meta-chip-tag-style:hover { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-outfit {
background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
color: #db2777;
border-color: #fbcfe8;
}
.meta-chip-tag-outfit:hover { background: linear-gradient(135deg, #db2777 0%, #be185d 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-scene {
background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
color: #15803d;
border-color: #bbf7d0;
}
.meta-chip-tag-scene:hover { background: linear-gradient(135deg, #15803d 0%, #166534 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-body {
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
color: #b45309;
border-color: #fde68a;
}
.meta-chip-tag-body:hover { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-mood {
background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
color: #7c3aed;
border-color: #e9d5ff;
}
.meta-chip-tag-mood:hover { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-topic {
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
color: #0369a1;
border-color: #bfdbfe;
}
.meta-chip-tag-topic:hover { background: linear-gradient(135deg, #0369a1 0%, #075985 100%); color: #fff; border-color: transparent; }
/* jieba 提取的新分类 */
.meta-chip-tag-noun {
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
color: #1d4ed8;
border-color: #bfdbfe;
}
.meta-chip-tag-noun:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-proper {
background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
color: #4338ca;
border-color: #c7d2fe;
}
.meta-chip-tag-proper:hover { background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-location {
background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
color: #047857;
border-color: #a7f3d0;
}
.meta-chip-tag-location:hover { background: linear-gradient(135deg, #047857 0%, #065f46 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-organization {
background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
color: #a16207;
border-color: #fde68a;
}
.meta-chip-tag-organization:hover { background: linear-gradient(135deg, #a16207 0%, #854d0e 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-noun_verb {
background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
color: #be185d;
border-color: #f9a8d4;
}
.meta-chip-tag-noun_verb:hover { background: linear-gradient(135deg, #be185d 0%, #9d174d 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-adj {
background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
color: #6d28d9;
border-color: #ddd6fe;
}
.meta-chip-tag-adj:hover { background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-verb {
background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
color: #c2410c;
border-color: #fed7aa;
}
.meta-chip-tag-verb:hover { background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-chinese {
background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
color: #475569;
border-color: #cbd5e1;
}
.meta-chip-tag-chinese:hover { background: linear-gradient(135deg, #475569 0%, #334155 100%); color: #fff; border-color: transparent; }
.meta-chip-tag-english {
background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
color: #64748b;
border-color: #cbd5e1;
}
.meta-chip-tag-english:hover { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: #fff; border-color: transparent; }
/* 默认标签 */
.meta-chip-tag-default,
.meta-chip-tag {
background: var(--bg-hover);
color: var(--text-light);
border-color: var(--border-gray);
}
.meta-chip-tag-default:hover,
.meta-chip-tag:hover { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: #fff; border-color: transparent; }
/* ============ 瀑布流布局(核心) ============ */
.images-grid {
column-count: 4;
column-gap: 16px;
margin-bottom: 40px;
}
/* 瀑布流中的每一项 */
.image-item {
position: relative;
display: inline-block;
width: 100%;
margin: 0 0 16px 0;
overflow: hidden;
border-radius: var(--radius-card);
box-shadow: var(--shadow-sm);
background: var(--bg-surface);
transition: all 0.3s ease;
border: 1px solid var(--border-gray);
break-inside: avoid;
page-break-inside: avoid;
}
.image-item:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
border-color: var(--secondary-blue);
}
/* 图片本身 - 保持原始比例(瀑布流关键) */
.image-item img {
width: 100%;
height: auto;
display: block;
object-fit: contain;
transition: transform 0.4s ease;
cursor: pointer;
}
.image-item:hover img {
transform: scale(1.02);
}
/* 图片说明 */
.image-caption {
padding: 10px 12px;
color: var(--text-light);
font-size: 0.8rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
border-top: 1px solid var(--border-gray);
cursor: default;
}
.image-caption small {
background: var(--bg-hover);
padding: 3px 8px;
border-radius: var(--radius-full);
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 500;
}
/* 收藏按钮 */
.favorite-btn {
position: absolute;
top: 10px;
right: 10px;
background: rgba(255, 255, 255, 0.92);
border: none;
border-radius: 50%;
width: 34px;
height: 34px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.25s ease;
backdrop-filter: blur(8px);
box-shadow: var(--shadow-sm);
opacity: 0;
z-index: 10;
}
.image-item:hover .favorite-btn { opacity: 1; }
.favorite-btn:hover {
transform: scale(1.12);
box-shadow: var(--shadow-md);
}
.favorite-btn.favorited {
color: var(--accent-pink);
background: rgba(236, 72, 153, 0.15);
}
.favorite-btn i { font-size: 15px; }
/* 图片加载状态 */
.image-loading {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
background: var(--bg-hover);
display: flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
}
.image-loading .fa-spinner {
font-size: 1.3rem;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 触摸设备收藏按钮常显 */
@media (hover: none) and (pointer: coarse) {
.favorite-btn { opacity: 0.8; }
.image-item:hover { transform: none; box-shadow: var(--shadow-sm); }
.image-item:active { transform: scale(0.98); }
}
/* ============ 响应式:瀑布流列数 ============ */
/* 大屏幕(默认):4列 */
@media (max-width: 1200px) {
.images-grid { column-count: 3; column-gap: 14px; }
.image-item { margin-bottom: 14px; }
}
/* 中等屏幕:3列 */
@media (max-width: 900px) {
.images-grid { column-count: 2; column-gap: 12px; }
.image-item { margin-bottom: 12px; }
.album-title { font-size: 1.6rem; }
}
/* 手机:2列 */
@media (max-width: 600px) {
.container { padding: 16px 12px; }
.images-grid { column-count: 2; column-gap: 10px; }
.image-item { margin-bottom: 10px; border-radius: var(--radius); }
.album-title { font-size: 1.3rem; padding: 0 10px; }
.album-info { font-size: 0.85rem; padding: 8px 14px; gap: 10px; }
.back-link { padding: 8px 14px; font-size: 0.85rem; }
.meta-chip { padding: 5px 11px; font-size: 0.8rem; }
.image-caption { padding: 8px 10px; font-size: 0.75rem; }
.favorite-btn { width: 30px; height: 30px; }
}
/* 小屏手机:1列 */
@media (max-width: 380px) {
.images-grid { column-count: 1; }
}
/* ============ 图片查看器(保持原样) ============ */
.preview-modal {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
visibility: hidden;
transition: all 0.25s ease;
}
.preview-modal.active { opacity: 1; visibility: visible; }
.preview-overlay {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0, 0, 0, 0.92);
backdrop-filter: blur(4px);
}
.preview-container {
position: relative;
width: 100vw;
height: 100vh;
max-width: 100vw;
max-height: 100vh;
display: flex;
flex-direction: column;
background: transparent;
border-radius: 0;
box-shadow: none;
transform: scale(1);
}
.preview-modal.active .preview-container { transform: scale(1); }
/* 顶部栏 - 浮在图片上方 */
.preview-header {
position: absolute;
top: 0; left: 0; right: 0;
z-index: 10;
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px;
background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
flex-shrink: 0;
border: none;
}
.preview-title h3 {
font-size: 1rem;
font-weight: 600;
color: #f1f5f9;
margin: 0 0 4px 0;
}
.preview-info { font-size: 0.8rem; color: #94a3b8; }
.preview-actions {
display: flex;
align-items: center;
gap: 12px;
}
.preview-nav {
width: 40px; height: 40px;
border: 1px solid rgba(255,255,255,0.15);
border-radius: 50%;
background: rgba(255,255,255,0.08);
color: #f1f5f9;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
backdrop-filter: blur(10px);
}
.preview-nav:hover:not(:disabled) {
background: rgba(255,255,255,0.2);
border-color: rgba(255,255,255,0.3);
color: #fff;
}
.preview-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.preview-counter {
font-size: 0.9rem;
color: #cbd5e1;
font-weight: 500;
padding: 0 4px;
}
.preview-close {
width: 40px; height: 40px;
border: 1px solid rgba(255,255,255,0.15);
border-radius: 50%;
background: rgba(255,255,255,0.08);
color: #f1f5f9;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
backdrop-filter: blur(10px);
}
.preview-close:hover { background: rgba(239, 68, 68, 0.8); color: #fff; border-color: rgba(239, 68, 68, 0.6); }
/* 图片内容区 - 占满全屏 */
.preview-content {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
padding: 60px 80px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
}
.preview-image-container {
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.preview-image {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
object-fit: contain;
transition: opacity 0.3s ease, transform 0.3s ease;
box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
border-radius: 4px;
}
.preview-loading {
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
color: #94a3b8;
}
.preview-loading i { font-size: 2rem; color: #3b82f6; }
/* 底部栏 - 浮在图片上方 */
.preview-footer {
position: absolute;
bottom: 0; left: 0; right: 0;
z-index: 10;
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
padding: 16px 24px;
background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
flex-shrink: 0;
border: none;
}
.preview-meta { display: flex; gap: 16px; flex: 1; }
.preview-meta .meta-item {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.8rem;
color: #cbd5e1;
}
/* 底部居中的切换控制栏 */
.preview-center-controls {
display: flex;
align-items: center;
gap: 16px;
flex: 1;
justify-content: center;
}
.preview-center-controls .preview-nav {
width: 40px;
height: 40px;
border: 1px solid rgba(255,255,255,0.2);
border-radius: 50%;
background: rgba(255,255,255,0.1);
color: #f1f5f9;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
backdrop-filter: blur(10px);
font-size: 0.9rem;
}
.preview-center-controls .preview-nav:hover:not(:disabled) {
background: rgba(255,255,255,0.25);
border-color: rgba(255,255,255,0.4);
transform: scale(1.08);
}
.preview-center-controls .preview-nav:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.preview-center-controls .preview-counter {
font-size: 0.9rem;
color: #e2e8f0;
font-weight: 500;
min-width: 60px;
text-align: center;
}
.preview-controls { display: flex; gap: 10px; flex: 1; justify-content: flex-end; }
.preview-action {
padding: 8px 16px;
border: 1px solid rgba(255,255,255,0.15);
border-radius: 20px;
background: rgba(255,255,255,0.08);
color: #f1f5f9;
cursor: pointer;
font-size: 0.8rem;
font-weight: 500;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 6px;
backdrop-filter: blur(10px);
}
.preview-action:hover { background: rgba(255,255,255,0.2); }
.preview-action-close:hover {
background: rgba(239, 68, 68, 0.7);
border-color: rgba(239, 68, 68, 0.5);
}
.preview-action.favorited { border-color: rgba(236, 72, 153, 0.5); color: #f9a8d4; background: rgba(236, 72, 153, 0.15); }
.preview-action.favorited:hover { background: rgba(236, 72, 153, 0.25); }
/* 暗色模式 */
@media (prefers-color-scheme: dark) {
:root {
--bg-primary: #0f172a;
--bg-surface: #1e293b;
--bg-hover: #334155;
--border-gray: #334155;
--text-dark: #f1f5f9;
--text-light: #cbd5e1;
--text-muted: #94a3b8;
}
}
/* 移动端适配 */
@media (max-width: 768px) {
.preview-content { padding: 40px 10px 70px; }
.preview-header, .preview-footer { padding: 12px 16px; }
.preview-footer { flex-wrap: wrap; gap: 12px; }
.preview-meta { order: 2; justify-content: center; }
.preview-center-controls { order: 1; width: 100%; }
.preview-controls { order: 3; justify-content: center; }
.preview-center-controls .preview-nav { width: 36px; height: 36px; }
}