560 lines
13 KiB
CSS
560 lines
13 KiB
CSS
/* ============================================================
|
||
相册详情页样式 - 瀑布流布局 + 分类标签
|
||
============================================================ */
|
||
|
||
: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: 16px;
|
||
color: var(--text-light);
|
||
font-size: 0.95rem;
|
||
padding: 10px 20px;
|
||
background: var(--bg-surface);
|
||
border-radius: var(--radius-full);
|
||
border: 1px solid var(--border-gray);
|
||
}
|
||
|
||
.album-info i { color: var(--secondary-blue); }
|
||
|
||
/* ============ 相册标签区(新:分类着色) ============ */
|
||
.album-meta-tags {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
margin: 20px auto 32px;
|
||
max-width: 900px;
|
||
}
|
||
|
||
.meta-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
padding: 6px 14px;
|
||
border-radius: var(--radius-full);
|
||
font-size: 0.85rem;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
user-select: none;
|
||
border: 1px solid transparent;
|
||
}
|
||
|
||
.meta-chip:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: var(--shadow-md);
|
||
}
|
||
|
||
.meta-chip:active { transform: translateY(0); }
|
||
|
||
.meta-chip i { font-size: 0.75rem; }
|
||
|
||
/* 人物标签 */
|
||
.meta-chip-person {
|
||
background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
|
||
color: var(--accent-purple);
|
||
border-color: rgba(139, 92, 246, 0.2);
|
||
}
|
||
|
||
.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: #f0f9ff;
|
||
color: #0284c7;
|
||
border-color: #bae6fd;
|
||
}
|
||
.meta-chip-tag-style:hover { background: #0284c7; color: #fff; border-color: #0284c7; }
|
||
|
||
.meta-chip-tag-outfit {
|
||
background: #fdf2f8;
|
||
color: #db2777;
|
||
border-color: #fbcfe8;
|
||
}
|
||
.meta-chip-tag-outfit:hover { background: #db2777; color: #fff; border-color: #db2777; }
|
||
|
||
.meta-chip-tag-scene {
|
||
background: #f0fdf4;
|
||
color: #15803d;
|
||
border-color: #bbf7d0;
|
||
}
|
||
.meta-chip-tag-scene:hover { background: #15803d; color: #fff; border-color: #15803d; }
|
||
|
||
.meta-chip-tag-body {
|
||
background: #fef3c7;
|
||
color: #b45309;
|
||
border-color: #fde68a;
|
||
}
|
||
.meta-chip-tag-body:hover { background: #b45309; color: #fff; border-color: #b45309; }
|
||
|
||
.meta-chip-tag-mood {
|
||
background: #faf5ff;
|
||
color: #7c3aed;
|
||
border-color: #e9d5ff;
|
||
}
|
||
.meta-chip-tag-mood:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }
|
||
|
||
.meta-chip-tag-topic {
|
||
background: #eff6ff;
|
||
color: #0369a1;
|
||
border-color: #bfdbfe;
|
||
}
|
||
.meta-chip-tag-topic:hover { background: #0369a1; color: #fff; border-color: #0369a1; }
|
||
|
||
/* 默认标签 */
|
||
.meta-chip-tag {
|
||
background: var(--bg-hover);
|
||
color: var(--text-light);
|
||
border-color: var(--border-gray);
|
||
}
|
||
.meta-chip-tag:hover { background: var(--text-light); color: #fff; border-color: var(--text-light); }
|
||
|
||
/* ============ 瀑布流布局(核心) ============ */
|
||
.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;
|
||
cursor: pointer;
|
||
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;
|
||
}
|
||
|
||
.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);
|
||
}
|
||
|
||
.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.3s ease;
|
||
}
|
||
|
||
.preview-modal.active { opacity: 1; visibility: visible; }
|
||
|
||
.preview-overlay {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
width: 100%; height: 100%;
|
||
background: rgba(15, 23, 42, 0.9);
|
||
backdrop-filter: blur(8px);
|
||
}
|
||
|
||
.preview-container {
|
||
position: relative;
|
||
background: var(--bg-surface);
|
||
border-radius: var(--radius-lg);
|
||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
||
max-width: 92vw;
|
||
max-height: 90vh;
|
||
width: 1200px;
|
||
height: 800px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
transform: scale(0.92);
|
||
transition: transform 0.3s ease;
|
||
}
|
||
|
||
.preview-modal.active .preview-container { transform: scale(1); }
|
||
|
||
.preview-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 16px 20px;
|
||
border-bottom: 1px solid var(--border-gray);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.preview-title h3 {
|
||
font-size: 1.1rem;
|
||
font-weight: 600;
|
||
color: var(--text-dark);
|
||
margin: 0 0 4px 0;
|
||
}
|
||
|
||
.preview-info { font-size: 0.85rem; color: var(--text-light); }
|
||
|
||
.preview-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
}
|
||
|
||
.preview-nav {
|
||
width: 36px; height: 36px;
|
||
border: 1px solid var(--border-gray);
|
||
border-radius: var(--radius);
|
||
background: var(--bg-surface);
|
||
color: var(--text-dark);
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.preview-nav:hover:not(:disabled) {
|
||
background: var(--bg-hover);
|
||
border-color: var(--secondary-blue);
|
||
color: var(--secondary-blue);
|
||
}
|
||
|
||
.preview-nav:disabled { opacity: 0.4; cursor: not-allowed; }
|
||
|
||
.preview-counter { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }
|
||
|
||
.preview-close {
|
||
width: 36px; height: 36px;
|
||
border: none;
|
||
border-radius: var(--radius);
|
||
background: var(--bg-hover);
|
||
color: var(--text-dark);
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.preview-close:hover { background: #ef4444; color: #fff; }
|
||
|
||
.preview-content {
|
||
flex: 1;
|
||
padding: 0;
|
||
overflow: hidden;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: #0f172a;
|
||
}
|
||
|
||
.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%;
|
||
object-fit: contain;
|
||
transition: opacity 0.3s ease;
|
||
}
|
||
|
||
.preview-loading {
|
||
position: absolute;
|
||
top: 50%; left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 8px;
|
||
color: var(--text-light);
|
||
}
|
||
|
||
.preview-loading i { font-size: 1.8rem; color: var(--secondary-blue); }
|
||
|
||
.preview-footer {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 12px 20px;
|
||
border-top: 1px solid var(--border-gray);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.preview-meta { display: flex; gap: 16px; }
|
||
|
||
.preview-meta .meta-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 0.85rem;
|
||
color: var(--text-light);
|
||
}
|
||
|
||
.preview-controls { display: flex; gap: 10px; }
|
||
|
||
.preview-action {
|
||
padding: 7px 14px;
|
||
border: 1px solid var(--border-gray);
|
||
border-radius: var(--radius);
|
||
background: var(--bg-surface);
|
||
color: var(--text-dark);
|
||
cursor: pointer;
|
||
font-size: 0.85rem;
|
||
font-weight: 500;
|
||
transition: all 0.2s ease;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
.preview-action:hover { background: var(--bg-hover); }
|
||
|
||
.preview-remove { border-color: #fecaca; color: #dc2626; }
|
||
.preview-remove:hover { background: #fef2f2; border-color: #fca5a5; }
|
||
|
||
.preview-action.favorited { border-color: #fbcfe8; color: #ec4899; background: #fdf2f8; }
|
||
.preview-action.favorited:hover { background: #fce7f3; border-color: #f9a8d4; }
|
||
|
||
/* 暗色模式 */
|
||
@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;
|
||
}
|
||
.preview-container { background: var(--bg-surface); }
|
||
.preview-nav, .preview-close, .preview-action { background: var(--bg-hover); color: var(--text-dark); border-color: var(--border-gray); }
|
||
}
|