You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1474 lines
45 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=375, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>青核 Youthome - 我的收藏</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../colors_and_type.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
:root {
/* Traework 设计令牌 - 圆角/间距/阴影/高度 */
--radius-xs: 4px;
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 20px;
--radius-full: 9999px;
--height-btn: 44px;
--height-input: 44px;
--height-nav: 64px;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
--shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);
--shadow-btn: 0 2px 8px rgba(38, 194, 187, 0.25);
--shadow-btn-hover: 0 4px 16px rgba(38, 194, 187, 0.35);
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
--shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
--shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.03);
--glass-bg: rgba(255, 255, 255, 0.72);
--glass-blur: blur(20px);
--glass-border: rgba(255, 255, 255, 0.3);
}
html, body {
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
background: var(--youth-bg-page);
color: var(--youth-text-primary);
min-height: 100vh;
overflow-x: hidden;
}
.app-container {
width: 375px;
height: 812px;
margin: 0 auto;
background: var(--youth-bg-page);
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
}
/* ===== 状态栏 ===== */
.status-bar {
height: 24px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
font-size: 12px;
font-weight: 600;
color: var(--youth-text-primary);
position: relative;
z-index: 10;
flex-shrink: 0;
}
.status-bar .right-icons {
display: flex;
align-items: center;
gap: 5px;
}
.status-bar svg {
width: 13px;
height: 13px;
}
/* ===== 顶部导航 ===== */
.nav-bar {
height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 12px;
position: relative;
flex-shrink: 0;
}
.nav-back-btn {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--youth-bg-card);
border: 1px solid var(--youth-border-light);
box-shadow: 0 2px 8px var(--youth-shadow-color), inset 0 1px 1px rgba(255,255,255,0.5);
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-primary);
}
.nav-back-btn:active {
transform: scale(0.92);
}
.nav-back-btn svg {
width: 18px;
height: 18px;
}
.nav-title {
font-size: 17px;
font-weight: 700;
color: var(--youth-text-primary);
position: absolute;
left: 50%;
transform: translateX(-50%);
letter-spacing: 0.3px;
}
.nav-manage-btn {
font-size: 14px;
font-weight: 500;
color: var(--youth-primary);
padding: 6px 12px;
border-radius: 999px;
cursor: pointer;
transition: all 0.2s ease;
background: var(--youth-primary-bg);
border: 1px solid var(--youth-primary-border);
}
.nav-manage-btn:active {
transform: scale(0.95);
opacity: 0.8;
}
.nav-manage-btn.editing {
background: var(--youth-gradient-primary);
color: #fff;
border: none;
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.3);
}
/* ===== 分段Tab控件 ===== */
.segment-tabs {
margin: 8px 16px 12px;
background: var(--youth-bg-input);
border-radius: 999px;
padding: 3px;
display: flex;
align-items: center;
box-shadow: inset 0 2px 4px rgba(0,0,0,0.06), inset 0 1px 2px rgba(0,0,0,0.04);
border: 1px solid var(--youth-border-light);
position: relative;
flex-shrink: 0;
}
.segment-tab {
flex: 1;
height: 34px;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
font-size: 12px;
font-weight: 500;
color: var(--youth-text-tertiary);
border-radius: 999px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
z-index: 1;
user-select: none;
white-space: nowrap;
}
.segment-tab.active {
color: #fff;
font-weight: 600;
background: var(--youth-gradient-primary);
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.3), 0 1px 3px rgba(0,0,0,0.1);
}
.segment-tab.active::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
border-radius: 999px 999px 0 0;
pointer-events: none;
}
.segment-tab .tab-count {
font-size: 10px;
font-weight: 600;
min-width: 16px;
height: 14px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 16px;
padding: 0 4px;
background: rgba(0,0,0,0.06);
color: var(--youth-text-tertiary);
line-height: 1;
}
.segment-tab.active .tab-count {
background: rgba(255, 255, 255, 0.25);
color: white;
}
/* ===== 搜索框 ===== */
.search-box {
margin: 0 16px 12px;
height: 36px;
display: flex;
align-items: center;
gap: 6px;
padding: 0 12px;
background: var(--youth-bg-input);
border-radius: 8px;
border: 1px solid var(--youth-border-light);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), inset 0 1px 2px rgba(0,0,0,0.03);
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
}
.search-box:active {
background: var(--youth-bg-hover);
}
.search-box svg {
width: 15px;
height: 15px;
color: var(--youth-text-tertiary);
flex-shrink: 0;
}
.search-box .search-placeholder {
font-size: 13px;
color: var(--youth-text-placeholder);
flex: 1;
}
/* ===== 收藏列表区 ===== */
.favorites-list {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 2px 16px 80px;
-webkit-overflow-scrolling: touch;
}
.favorites-list::-webkit-scrollbar {
display: none;
}
.fav-card {
background: var(--youth-bg-card);
border-radius: 16px;
padding: 12px;
box-shadow: 0 2px 12px var(--youth-shadow-card);
border: 1px solid var(--youth-border-light);
position: relative;
overflow: hidden;
margin-bottom: 10px;
cursor: pointer;
transition: all 0.25s ease;
}
.fav-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
pointer-events: none;
}
.fav-card:active {
transform: scale(0.98);
box-shadow: 0 1px 6px var(--youth-shadow-card);
}
.fav-card.editing .delete-check {
display: flex;
}
.delete-check {
display: none;
position: absolute;
top: 10px;
right: 10px;
width: 20px;
height: 20px;
border-radius: 50%;
border: 1.5px solid var(--youth-border-dark);
align-items: center;
justify-content: center;
z-index: 5;
background: var(--youth-bg-card);
transition: all 0.2s ease;
}
.delete-check.checked {
background: var(--youth-gradient-primary);
border-color: transparent;
}
.delete-check svg {
width: 12px;
height: 12px;
color: #fff;
}
/* 类型标签胶囊 */
.type-pill {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 2px 8px;
border-radius: 999px;
font-size: 10px;
font-weight: 600;
line-height: 1.6;
position: relative;
overflow: hidden;
}
.type-pill::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
pointer-events: none;
}
.type-pill.post {
background: linear-gradient(135deg, #54CAC5 0%, #26C2BB 100%);
color: #fff;
box-shadow: 0 1px 4px rgba(38, 194, 187, 0.25);
}
.type-pill.activity {
background: linear-gradient(135deg, #FFC58A 0%, #FF9F45 100%);
color: #fff;
box-shadow: 0 1px 4px rgba(255, 159, 69, 0.25);
}
.type-pill.topic {
background: linear-gradient(135deg, #A594FF 0%, #7B61FF 100%);
color: #fff;
box-shadow: 0 1px 4px rgba(123, 97, 255, 0.25);
}
/* ===== 动态卡片 ===== */
.post-card-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.post-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: linear-gradient(135deg, #FFD8A8 0%, #FFB980 50%, #E8A06B 100%);
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 700;
color: #fff;
flex-shrink: 0;
position: relative;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.post-avatar::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
}
.post-user-info {
flex: 1;
min-width: 0;
}
.post-nickname {
font-size: 13px;
font-weight: 600;
color: var(--youth-text-primary);
line-height: 1.2;
}
.post-school {
font-size: 10px;
color: var(--youth-text-tertiary);
margin-top: 1px;
}
.post-time {
font-size: 11px;
color: var(--youth-text-tertiary);
flex-shrink: 0;
}
.post-body {
display: flex;
gap: 10px;
margin-bottom: 8px;
}
.post-text {
flex: 1;
font-size: 13px;
line-height: 1.5;
color: var(--youth-text-primary);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.post-thumb {
width: 56px;
height: 56px;
border-radius: 12px;
flex-shrink: 0;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #7ED6D2 0%, #26C2BB 50%, #198A85 100%);
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.post-thumb::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
}
.post-thumb-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 22px;
}
.post-stats {
display: flex;
align-items: center;
gap: 12px;
padding-top: 8px;
border-top: 1px solid var(--youth-border-light);
}
.post-stat-item {
display: flex;
align-items: center;
gap: 3px;
font-size: 11px;
color: var(--youth-text-tertiary);
}
.post-stat-item svg {
width: 13px;
height: 13px;
}
.post-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
}
/* ===== 活动卡片 ===== */
.activity-card-inner {
display: flex;
gap: 10px;
}
.activity-cover {
width: 72px;
height: 72px;
border-radius: 12px;
flex-shrink: 0;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #FFD8A8 0%, #FFB980 50%, #E8A06B 100%);
box-shadow: 0 2px 8px rgba(255, 159, 69, 0.3);
display: flex;
align-items: center;
justify-content: center;
}
.activity-cover::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
}
.activity-cover-icon {
font-size: 30px;
position: relative;
z-index: 1;
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.activity-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.activity-title {
font-size: 14px;
font-weight: 600;
color: var(--youth-text-primary);
line-height: 1.3;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.activity-meta {
display: flex;
flex-direction: column;
gap: 4px;
}
.activity-time-loc {
font-size: 11px;
color: var(--youth-text-tertiary);
display: flex;
align-items: center;
gap: 3px;
}
.activity-time-loc svg {
width: 11px;
height: 11px;
flex-shrink: 0;
}
.activity-people {
font-size: 11px;
color: var(--youth-text-secondary);
display: flex;
align-items: center;
gap: 3px;
}
.activity-people svg {
width: 11px;
height: 11px;
flex-shrink: 0;
color: var(--youth-primary);
}
.activity-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid var(--youth-border-light);
}
.status-pill {
display: inline-flex;
align-items: center;
gap: 3px;
padding: 3px 8px;
border-radius: 999px;
font-size: 10px;
font-weight: 600;
background: linear-gradient(135deg, #FFD8A8 0%, #FFB980 100%);
color: #fff;
position: relative;
overflow: hidden;
box-shadow: 0 1px 4px rgba(255, 185, 128, 0.3);
}
.status-pill::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
}
.status-pill span {
position: relative;
z-index: 1;
}
.status-pill .dot {
width: 5px;
height: 5px;
border-radius: 50%;
background: #fff;
position: relative;
z-index: 1;
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
/* ===== 话题卡片 ===== */
.topic-card-inner {
display: flex;
gap: 12px;
align-items: center;
}
.topic-icon-wrap {
width: 50px;
height: 50px;
border-radius: 14px;
flex-shrink: 0;
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #C4B8FF 0%, #9B8DFF 50%, #7B61FF 100%);
box-shadow: 0 2px 8px rgba(123, 97, 255, 0.3);
display: flex;
align-items: center;
justify-content: center;
}
.topic-icon-wrap::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 100%);
}
.topic-icon-wrap .hash-icon {
font-size: 22px;
font-weight: 800;
color: #fff;
position: relative;
z-index: 1;
text-shadow: 0 2px 4px rgba(0,0,0,0.15);
line-height: 1;
}
.topic-info {
flex: 1;
min-width: 0;
}
.topic-title {
font-size: 14px;
font-weight: 700;
color: var(--youth-text-primary);
line-height: 1.3;
margin-bottom: 4px;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
.topic-meta {
display: flex;
align-items: center;
gap: 8px;
}
.topic-participants {
font-size: 11px;
color: var(--youth-text-tertiary);
display: flex;
align-items: center;
gap: 3px;
}
.topic-participants svg {
width: 11px;
height: 11px;
}
.hot-badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 16px;
border-radius: 4px;
background: linear-gradient(135deg, #FF8A8A 0%, #FF6B6B 100%);
color: #fff;
font-size: 10px;
font-weight: 700;
position: relative;
overflow: hidden;
box-shadow: 0 1px 4px rgba(255, 107, 107, 0.3);
}
.hot-badge::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
}
.hot-badge span {
position: relative;
z-index: 1;
}
.topic-card-footer {
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid var(--youth-border-light);
}
/* ===== 底部Tab导航 ===== */
.bottom-nav {
height: 64px;
flex-shrink: 0;
background: var(--youth-bg-glass);
backdrop-filter: blur(20px) saturate(180%);
-webkit-backdrop-filter: blur(20px) saturate(180%);
border-top: 1px solid var(--youth-border-light);
display: flex;
align-items: flex-start;
justify-content: space-around;
padding: 6px 0 0;
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 20;
}
.bottom-tab {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 3px 10px;
cursor: pointer;
transition: all 0.2s ease;
color: var(--youth-text-tertiary);
user-select: none;
}
.bottom-tab:active {
transform: scale(0.92);
}
.bottom-tab.active {
color: var(--youth-primary);
}
.bottom-tab svg {
width: 22px;
height: 22px;
}
.bottom-tab .tab-label {
font-size: 10px;
font-weight: 500;
}
.bottom-tab.active .tab-label {
font-weight: 600;
}
.bg-decoration-2 {
position: absolute;
bottom: 120px;
left: -60px;
width: 180px;
height: 180px;
background: radial-gradient(circle, rgba(255, 185, 128, 0.06) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
z-index: 0;
}
.content-wrap {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
}
/* ===== Tab内容切换动画 ===== */
.tab-content {
display: none;
animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-content.active {
display: block;
}
@keyframes fadeSlideIn {
from {
opacity: 0;
transform: translateY(6px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 编辑模式底部操作栏 */
.edit-bar {
position: absolute;
bottom: 60px;
left: 0;
right: 0;
height: 56px;
background: var(--youth-bg-glass);
backdrop-filter: blur(20px) saturate(180%);
-webkit-backdrop-filter: blur(20px) saturate(180%);
border-top: 1px solid var(--youth-border-light);
display: none;
align-items: center;
justify-content: space-between;
padding: 0 16px;
z-index: 15;
animation: slideUp 0.3s ease;
}
.edit-bar.active {
display: flex;
}
@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.edit-bar-info {
font-size: 13px;
color: var(--youth-text-secondary);
}
.edit-bar-info strong {
color: var(--youth-primary);
font-weight: 600;
}
.edit-bar-actions {
display: flex;
gap: 8px;
}
.edit-bar-btn {
padding: 7px 16px;
border-radius: 999px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.edit-bar-btn:active {
transform: scale(0.95);
}
.edit-bar-btn.cancel {
background: var(--youth-bg-input);
color: var(--youth-text-secondary);
border: 1px solid var(--youth-border-light);
}
.edit-bar-btn.delete {
background: linear-gradient(135deg, #FF665F 0%, #FF3B30 100%);
color: #fff;
box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}
/* SVG 图标统一尺寸 */
.icon-svg {
display: inline-flex;
align-items: center;
justify-content: center;
width: 1em;
height: 1em;
vertical-align: middle;
line-height: 1;
}
.icon-svg svg {
width: 100%;
height: 100%;
stroke: currentColor;
}
/* 侧栏图标 */
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
/* 社团logo图标 */
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
/* 头图大图标 */
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
/* meta 小图标 */
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
/* 分类选择网格图标 */
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
/* logo预览图标 */
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
/* 提示图标 */
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
</style>
</head>
<body>
<div class="app-container" id="page-favorites">
<!-- 背景装饰 -->
<div class="bg-decoration"></div>
<div class="bg-decoration-2"></div>
<div class="content-wrap">
<!-- 状态栏 -->
<div class="status-bar">
<span>9:41</span>
<div class="right-icons">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z"></path>
</svg>
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M15.67 4H14V2h-4v2H8.33C7.6 4 7 4.6 7 5.33v15.33C7 21.4 7.6 22 8.33 22h7.33c.74 0 1.34-.6 1.34-1.33V5.33C17 4.6 16.4 4 15.67 4z"></path>
</svg>
</div>
</div>
<!-- 顶部导航 -->
<div class="nav-bar">
<button class="nav-back-btn" data-dom-id="btn-back" onclick="goBack()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"></polyline>
</svg>
</button>
<span class="nav-title">我的收藏</span>
<button class="nav-manage-btn" data-dom-id="btn-manage" onclick="toggleEditMode()">
管理
</button>
</div>
<!-- 分类Tab -->
<div class="segment-tabs">
<div class="segment-tab active" data-dom-id="tab-all" data-tab="all" onclick="switchTab('all')">
全部
<span class="tab-count">28</span>
</div>
<div class="segment-tab" data-dom-id="tab-posts" data-tab="posts" onclick="switchTab('posts')">
动态
<span class="tab-count">15</span>
</div>
<div class="segment-tab" data-dom-id="tab-activities" data-tab="activities" onclick="switchTab('activities')">
活动
<span class="tab-count">8</span>
</div>
<div class="segment-tab" data-dom-id="tab-topics" data-tab="topics" onclick="switchTab('topics')">
话题
<span class="tab-count">5</span>
</div>
</div>
<!-- 搜索框 -->
<div class="search-box" data-dom-id="btn-search" onclick="handleSearch()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
<span class="search-placeholder">搜索收藏内容</span>
</div>
<!-- 收藏列表 -->
<div class="favorites-list">
<!-- 全部Tab内容 -->
<div class="tab-content active" id="content-all">
<!-- 动态卡片 -->
<div class="fav-card" data-dom-id="fav-card-1" data-type="post" onclick="handleCardClick('post', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 1)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="post-card-header">
<div class="post-avatar">李</div>
<div class="post-user-info">
<div class="post-nickname">李同学</div>
<div class="post-school">清华大学·计算机系</div>
</div>
<span class="post-time">2天前</span>
</div>
<div class="post-body">
<div class="post-text">期末图书馆自习打卡Day5<span class="icon-svg icon-book-open"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg></span> 今天效率超高,高数复习了三章,明天继续加油!有没有一起图书馆约自习的小伙伴~</div>
<div class="post-thumb">
</div>
</div>
<div class="post-card-footer">
<div class="post-stats" style="border: none; padding: 0;">
<div class="post-stat-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
</svg>
48
</div>
<div class="post-stat-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
</svg>
12
</div>
</div>
<span class="type-pill post">动态</span>
</div>
</div>
<!-- 活动卡片 -->
<div class="fav-card" data-dom-id="fav-card-2" data-type="activity" onclick="handleCardClick('activity', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 2)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="activity-card-inner">
<div class="activity-cover">
</div>
<div class="activity-info">
<div class="activity-title">周末羽毛球双打约起来🏸</div>
<div class="activity-meta">
<div class="activity-time-loc">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
周六 14:00 · 校内羽毛球馆
</div>
<div class="activity-people">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
3/4人
</div>
</div>
</div>
</div>
<div class="activity-card-footer">
<div class="status-pill">
<span class="dot"></span>
<span>报名中</span>
</div>
<span class="type-pill activity">活动</span>
</div>
</div>
<!-- 话题卡片 -->
<div class="fav-card" data-dom-id="fav-card-3" data-type="topic" onclick="handleCardClick('topic', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 3)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="topic-card-inner">
<div class="topic-icon-wrap">
<span class="hash-icon">#</span>
</div>
<div class="topic-info">
<div class="topic-title">#期末加油打卡挑战</div>
<div class="topic-meta">
<div class="topic-participants">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
1.2万人参与
</div>
<div class="hot-badge">
<span>热</span>
</div>
</div>
</div>
</div>
<div class="topic-card-footer">
<span class="type-pill topic">话题</span>
</div>
</div>
</div>
<!-- 动态Tab内容 -->
<div class="tab-content" id="content-posts">
<div class="fav-card" data-type="post" onclick="handleCardClick('post', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 1)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="post-card-header">
<div class="post-avatar">李</div>
<div class="post-user-info">
<div class="post-nickname">李同学</div>
<div class="post-school">清华大学·计算机系</div>
</div>
<span class="post-time">2天前</span>
</div>
<div class="post-body">
<div class="post-text">期末图书馆自习打卡Day5<span class="icon-svg icon-book-open"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg></span> 今天效率超高,高数复习了三章,明天继续加油!有没有一起图书馆约自习的小伙伴~</div>
<div class="post-thumb">
<span class="post-thumb-icon"><span class="icon-svg icon-book-open"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg></span></span>
</div>
</div>
<div class="post-card-footer">
<div class="post-stats" style="border: none; padding: 0;">
<div class="post-stat-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
</svg>
48
</div>
<div class="post-stat-item">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
</svg>
12
</div>
</div>
<span class="type-pill post">动态</span>
</div>
</div>
</div>
<!-- 活动Tab内容 -->
<div class="tab-content" id="content-activities">
<div class="fav-card" data-type="activity" onclick="handleCardClick('activity', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 2)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="activity-card-inner">
<div class="activity-cover">
<span class="activity-cover-icon">🏸</span>
</div>
<div class="activity-info">
<div class="activity-title">周末羽毛球双打约起来🏸</div>
<div class="activity-meta">
<div class="activity-time-loc">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
周六 14:00 · 校内羽毛球馆
</div>
<div class="activity-people">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
3/4人
</div>
</div>
</div>
</div>
<div class="activity-card-footer">
<div class="status-pill">
<span class="dot"></span>
<span>报名中</span>
</div>
<span class="type-pill activity">活动</span>
</div>
</div>
</div>
<!-- 话题Tab内容 -->
<div class="tab-content" id="content-topics">
<div class="fav-card" data-type="topic" onclick="handleCardClick('topic', 1)">
<div class="delete-check" onclick="toggleDeleteCheck(event, 3)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<div class="topic-card-inner">
<div class="topic-icon-wrap">
<span class="hash-icon">#</span>
</div>
<div class="topic-info">
<div class="topic-title">#期末加油打卡挑战</div>
<div class="topic-meta">
<div class="topic-participants">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
<circle cx="9" cy="7" r="4"></circle>
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
</svg>
1.2万人参与
</div>
<div class="hot-badge">
<span>热</span>
</div>
</div>
</div>
</div>
<div class="topic-card-footer">
<span class="type-pill topic">话题</span>
</div>
</div>
</div>
</div>
<!-- 编辑模式底部操作栏 -->
<div class="edit-bar" id="editBar">
<div class="edit-bar-info">
已选择 <strong id="selectedCount">0</strong> 项
</div>
<div class="edit-bar-actions">
<button class="edit-bar-btn cancel" onclick="toggleEditMode()">取消</button>
<button class="edit-bar-btn delete" onclick="handleDeleteSelected()">取消收藏</button>
</div>
</div>
<!-- 底部Tab导航 -->
</div>
</div>
<script>// ===== 主题切换 =====
// 初始化主题
})();
// ===== 返回按钮 =====
function goBack() {
window.location.href = 'profile-home.html';
}
// ===== 搜索 =====
function handleSearch() {
alert('搜索收藏内容');
}
// ===== 分类Tab切换 =====
let currentTab = 'all';
function switchTab(tabName) {
if (currentTab === tabName) return;
// 更新分段Tab状态
const tabs = document.querySelectorAll('.segment-tab');
tabs.forEach(tab => {
const tabType = tab.getAttribute('data-tab');
tab.classList.remove('active');
if (tabType === tabName) {
tab.classList.add('active');
}
});
// 更新内容区显示
const contents = document.querySelectorAll('.tab-content');
contents.forEach(content => {
content.classList.remove('active');
});
const targetContent = document.getElementById('content-' + tabName);
if (targetContent) {
targetContent.classList.add('active');
}
currentTab = tabName;
// 重置滚动位置
const scrollEl = document.querySelector('.favorites-list');
if (scrollEl) {
scrollEl.scrollTop = 0;
}
}
// ===== 卡片点击跳转 =====
function handleCardClick(type, id) {
// 编辑模式下点击卡片不跳转,切换选中状态
if (isEditMode) {
toggleDeleteCheck({ stopPropagation: function() {} }, id);
return;
}
const pageMap = {
'post': 'post-detail.html',
'activity': 'activity-list.html',
'topic': '#'
};
if (pageMap[type] && pageMap[type] !== '#') {
window.location.href = pageMap[type];
} else if (type === 'topic') {
alert('跳转到话题详情页');
}
}
// ===== 编辑模式 =====
let isEditMode = false;
let selectedItems = new Set();
function toggleEditMode() {
isEditMode = !isEditMode;
const manageBtn = document.querySelector('[data-dom-id="btn-manage"]');
const editBar = document.getElementById('editBar');
const cards = document.querySelectorAll('.fav-card');
if (isEditMode) {
manageBtn.textContent = '完成';
manageBtn.classList.add('editing');
editBar.classList.add('active');
cards.forEach(card => card.classList.add('editing'));
} else {
manageBtn.textContent = '管理';
manageBtn.classList.remove('editing');
editBar.classList.remove('active');
cards.forEach(card => card.classList.remove('editing'));
// 清除所有选中
selectedItems.clear();
updateSelectedCount();
document.querySelectorAll('.delete-check').forEach(el => {
el.classList.remove('checked');
});
}
}
function toggleDeleteCheck(event, id) {
event.stopPropagation();
if (!isEditMode) return;
const checkEl = event.currentTarget || event.target.closest('.delete-check');
if (selectedItems.has(id)) {
selectedItems.delete(id);
checkEl.classList.remove('checked');
} else {
selectedItems.add(id);
checkEl.classList.add('checked');
}
updateSelectedCount();
}
function updateSelectedCount() {
const countEl = document.getElementById('selectedCount');
if (countEl) {
countEl.textContent = selectedItems.size;
}
}
function handleDeleteSelected() {
if (selectedItems.size === 0) {
alert('请先选择要取消收藏的内容');
return;
}
if (confirm(`确定要取消收藏选中的 ${selectedItems.size} 项内容吗?`)) {
// 移除选中的卡片
selectedItems.forEach(id => {
const card = document.querySelector(`[data-dom-id="fav-card-${id}"]`);
if (card) {
card.style.transition = 'all 0.3s ease';
card.style.opacity = '0';
card.style.transform = 'translateX(-20px) scale(0.95)';
setTimeout(() => {
card.style.display = 'none';
}, 300);
}
});
setTimeout(() => {
selectedItems.clear();
updateSelectedCount();
toggleEditMode();
}, 350);
}
}
// ===== 底部Tab切换 =====
function switchBottomTab(tabName) {
const tabs = document.querySelectorAll('.bottom-tab');
tabs.forEach(tab => tab.classList.remove('active'));
const activeTab = document.querySelector(`[data-dom-id="tab-${tabName}"]`);
if (activeTab) {
activeTab.classList.add('active');
}
// 页面跳转映射
const pageMap = {
'home': 'feed-home.html',
'activity': 'activity-list.html',
'message': 'message-list.html',
'discover': 'campus-radar.html',
'profile': 'profile-home.html'
};
if (tabName !== 'profile' && pageMap[tabName]) {
window.location.href = pageMap[tabName];
}
}</script>
</body>
</html>