/* =========================================
   全局重置与基础设定
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 全局禁用长按选择和复制 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* 允许表单元素选择和复制 */
input,
textarea,
select,
.form-group input,
.form-group textarea,
.form-group select,
.form-group {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

:root {
    /* 主色调 - 柔和淡粉 */
    --primary-gradient: linear-gradient(135deg, #f5c6d0 0%, #e8b4b8 100%);
    --primary: #e8b4b8;
    --primary-light: #f5d5d8;
    --primary-dark: #d4a0a5;
    
    /* 辅助色 - 暖灰 */
    --accent: #f5f0eb;
    --accent-light: #faf7f5;
    
    /* 背景系统 - 极简白色 */
    --bg-base: #fafafa;
    --bg-gradient-1: #f8f6f4;
    --bg-gradient-2: #f5f0eb;
    --bg-gradient-3: #f8f6f4;
    
    /* 玻璃拟态背景 */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* 文字系统 - 优化字体栈 */
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --text-on-primary: #ffffff;
    --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    
    /* 阴影系统 */
    --shadow-sm: 0 2px 8px rgba(232, 180, 184, 0.08);
    --shadow-md: 0 4px 16px rgba(232, 180, 184, 0.12);
    --shadow-lg: 0 8px 32px rgba(232, 180, 184, 0.15);
    --shadow-glow: 0 0 20px rgba(232, 180, 184, 0.3);
    
    /* 圆角系统 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* 动画系统 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 冬季主题 */
[data-theme="winter"] {
    --primary-gradient: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    --primary: #a1c4fd;
    --primary-light: #dbeafe;
    --primary-dark: #60a5fa;
    --bg-base: #f0f9ff;
    --bg-gradient-1: #e0f2fe;
    --bg-gradient-2: #f0f9ff;
    --text-primary: #0c4a6e;
}

/* 情人节主题 */
[data-theme="valentine"] {
    --primary-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    --primary: #ff9a9e;
    --primary-light: #ffe4e6;
    --primary-dark: #f43f5e;
    --bg-base: #fff1f2;
    --bg-gradient-1: #ffe4e6;
    --bg-gradient-2: #fff1f2;
    --text-primary: #881337;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   布局容器
   ========================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   导航栏组件
   ========================================= */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* 性能优化 */
    will-change: background, box-shadow;
}

/* 导航栏滚动后的状态 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.navbar .container > .nav-menu {
    margin-left: auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.logo-link {
    text-decoration: none;
    font-size: 1.25rem;
    transition: transform var(--transition-base);
}

.logo-link:hover {
    transform: scale(1.1);
}

.username-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-base);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.username-text:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-base);
    padding: 0.35rem 0.4rem;
    position: relative;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width var(--transition-base);
}

/* 主题切换器样式 */
.theme-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.theme-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    transform: scale(1.2);
}

.theme-btn.active {
    border-color: var(--text-primary);
}

.theme-default { background: var(--primary); }
.theme-winter { background: #a1c4fd; }
.theme-valentine { background: #ff9a9e; }

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
}

/* 汉堡菜单激活状态 - 变成 X 形 */
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   Hero 区域
   ========================================= */
.hero {
    padding: 2rem 0 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out;
    font-family: var(--font-display);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-actions {
    margin-top: 1rem;
}

/* =========================================
   通用区块标题
   ========================================= */
.section {
    padding: 2rem 0 5rem;
}

.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* =========================================
   按钮组件
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    /* 性能优化 */
    will-change: transform;
    backface-visibility: hidden;
}

/* 按钮点击波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary::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: var(--transition-base);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-gradient);
    color: var(--text-on-primary);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-full {
    width: 100%;
}

/* =========================================
   卡片组件
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card,
.intro-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.card:hover,
.intro-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* =========================================
   表单组件
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition-base);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.form-group textarea {
    resize: none;
    overflow-y: auto;
    height: 120px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* =========================================
   页脚
   ========================================= */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* =========================================
   恋爱计时器
   ========================================= */
.timer-section {
    padding: 2rem 0 3rem;
}

.timer-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.timer-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    min-width: 90px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.timer-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.timer-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.start-date {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* =========================================
   功能卡片区域
   ========================================= */
.intro-section {
    display: none;
}

/* =========================================
   时间轴
   ========================================= */
/* 故事页底部增加留白 */
.timeline-section {
    padding: 2rem 0 5rem;
}

.story-form-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-form-container.visible {
    display: flex;
    opacity: 1;
}

.story-form-container .story-form {
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #fdf8ff 100%);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.story-form-container .story-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.story-form h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* 悬浮按钮键盘避让优化 */
.fab-btn {
    bottom: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当页面底部有输入框获得焦点时，隐藏悬浮按钮 */
body:has(textarea:focus, input:focus) .fab-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* 小屏幕额外优化 */
@media (max-width: 480px) {
    .fab-btn {
        bottom: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-light) 100%);
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd),
.timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    top: 5px;
    left: 22px;
    box-shadow: 0 0 0 4px rgba(232, 180, 184, 0.2);
    z-index: 1;
    transition: all var(--transition-base);
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(232, 180, 184, 0.3);
}



.timeline-content {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
}

.timeline-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #e8e8e8;
}



.timeline-date {
    display: inline-block;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
}

.timeline-date.date-clickable {
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s ease;
}

.timeline-date.date-clickable:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 标题和日期一行布局 */
.timeline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

/* 手机端日期全部左对齐 */
@media (max-width: 768px) {
    /* 手机端改为单列居中布局 */
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 60px;
        padding-right: 0;
        text-align: left !important;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }
    
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 22px;
        right: auto;
    }
    
    .timeline-item:nth-child(even) .timeline-header {
        flex-direction: row;
    }
    
    .timeline-content {
        padding: 1.25rem;
    }
    
    .timeline-title {
        font-size: 1.15rem;
    }
    
    .story-actions {
        opacity: 1;
    }
}

.timeline-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    min-width: 0;
    font-weight: 600;
    line-height: 1.4;
}

.timeline-desc {
    color: var(--text-secondary);
    line-height: 1.8;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.timeline-desc.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3.6em; /* 2行 * 1.8行高 */
}

.timeline-desc.expanded {
    -webkit-line-clamp: unset;
    max-height: 2000px;
}

/* 可折叠卡片交互样式 */
.timeline-content.has-collapsible {
    cursor: pointer;
}

.timeline-content.has-collapsible:active {
    background: #fafafa;
}

/* 需要登录提示样式 */
.auth-required {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.auth-required-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.auth-required h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-required p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.auth-required-hint {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 1rem;
}

.btn-expand {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: rgba(232, 180, 184, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-expand:hover {
    background: var(--primary-gradient);
    color: white;
}

.story-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    background: rgba(232, 180, 184, 0.1);
}

.story-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 故事操作按钮 */
.story-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f5f5f5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.timeline-content:hover .story-actions {
    opacity: 1;
}

.btn-edit-story,
.btn-delete-story {
    padding: 0.3rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-edit-story {
    background: #f5f5f5;
    color: var(--text-secondary);
}

.btn-edit-story:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-delete-story {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-delete-story:hover {
    background: #fed7d7;
    color: #c53030;
}

/* =========================================
   照片墙
   ========================================= */
.gallery-section {
    padding: 2rem 0 5rem;
    min-height: 60vh;
}

.upload-btn {
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
    display: inline-block;
}

/* 故事和照片的新增入口 */
.story-action,
.upload-action {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.write-message-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 悬浮按钮（FAB） */
.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.fab-btn:active {
    transform: scale(0.95);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 2px solid var(--primary-light);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    will-change: transform, opacity;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(232, 180, 184, 0.4);
}

.back-to-top:active {
    transform: scale(0.95);
}

.upload-form-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.upload-form-container.show {
    display: flex;
    opacity: 1;
}

.upload-form-container .upload-form {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
    position: relative;
    opacity: 1 !important;
    background-image: none !important;
    background-color: #ffffff !important;
}

/* 强制覆盖弹窗内所有半透明元素 */
.upload-form-container .upload-form .upload-dropzone {
    background: #f8f9fa !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.upload-form-container .upload-form .form-group input,
.upload-form-container .upload-form .form-group textarea {
    background: #f8f9fa !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.upload-form-container .upload-form .form-group input:focus,
.upload-form-container .upload-form .form-group textarea:focus {
    background: #ffffff !important;
}

.upload-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.upload-form-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.upload-dropzone {
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: #f0f2f8;
    transform: scale(1.02);
}

.upload-dropzone.has-image {
    padding: 0;
    border-style: solid;
}

.upload-label {
    display: block;
    cursor: pointer;
}

.file-input {
    display: none;
}

.upload-preview {
    position: relative;
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.remove-image:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-message {
    min-height: 2rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.btn-submit {
    flex: 1;
    position: relative;
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-submit.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    min-height: 100px;
    /* 性能优化 */
    contain: layout style paint;
}

.gallery-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease-out forwards;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    will-change: transform;
    backface-visibility: hidden;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
}

.gallery-placeholder {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
}

.gallery-placeholder img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    /* 图片懒加载优化 */
    opacity: 0;
    animation: imageFadeIn 0.5s ease-out forwards;
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item:hover .gallery-placeholder img {
    transform: scale(1.1);
}

.gallery-actions {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.btn-gallery-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    opacity: 0.6;
}

.btn-gallery-delete:hover {
    opacity: 1;
    background: rgba(245, 101, 101, 0.1);
    transform: scale(1.2);
}

.gallery-caption {
    padding: 1.5rem;
}

.gallery-caption h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gallery-caption p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 心情图表容器 */
.mood-chart-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto 0;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* 愿望清单进度条 */
.wishlist-progress {
    width: 100%;
    height: 12px;
    background: var(--accent);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1rem 0;
}

.wishlist-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
}

/* 愿望清单新版样式 */
.wish-add-card {
    max-width: 600px;
    margin: 0 auto 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.wish-add-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wish-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    transition: all var(--transition-base);
    outline: none;
}

.wish-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.2);
}

.wish-progress-section {
    text-align: center;
    margin-bottom: 2rem;
}

.wish-progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.wish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.wish-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
    overflow: hidden;
}

.wish-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.wish-card.wish-completed {
    opacity: 0.85;
}

.wish-card.wish-has-photo {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(232, 180, 184, 0.25);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(245, 198, 208, 0.15));
}

.wish-card-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
}

.wish-check-area {
    flex-shrink: 0;
}

.wish-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.wish-checkbox-label:hover {
    background: rgba(232, 180, 184, 0.15);
    transform: scale(1.1);
}

.wish-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.wish-checkmark {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    display: none;
}

.wish-checkbox:checked ~ .wish-checkmark {
    display: block;
}

.wish-checkbox:checked ~ .wish-checkbox-label,
.wish-checkbox:checked + .wish-checkmark {
    /* handled by parent */
}

.wish-checkbox-label:has(.wish-checkbox:checked) {
    background: var(--primary-gradient);
    border-color: transparent;
}

.wish-checkbox-label:has(.wish-checkbox:checked) .wish-checkmark {
    display: block;
}

.wish-content-area {
    flex: 1;
    min-width: 0;
}

.wish-title {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

.wish-completed .wish-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.wish-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2rem 0.7rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-full);
    margin-top: 0.4rem;
}

.wish-photo-indicator {
    font-size: 0.8rem;
    color: var(--primary-dark);
    margin-top: 0.3rem;
}

.wish-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wish-card:hover .wish-actions {
    opacity: 1;
}

.btn-wish-add-photo,
.btn-wish-delete {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.btn-wish-add-photo {
    background: rgba(232, 180, 184, 0.15);
    color: var(--primary-dark);
}

.btn-wish-add-photo:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.15);
}

.btn-wish-delete {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
}

.btn-wish-delete:hover {
    background: #fed7d7;
    transform: scale(1.15);
}

.wish-photo-thumb {
    width: 100%;
    height: 160px;
    overflow: hidden;
    cursor: pointer;
    border-top: 1px solid rgba(232, 180, 184, 0.2);
}

.wish-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.wish-photo-thumb:hover img {
    transform: scale(1.05);
}

/* 愿望复选框 */
.wish-checkbox-label.checked {
    background: var(--primary-gradient);
    border-color: transparent;
}

.wish-checkbox-label.checked .wish-checkmark {
    display: block;
}

/* 响应式：手机端愿望表单 */
@media (max-width: 768px) {
    .wish-add-form {
        flex-direction: column;
    }
    
    .wish-grid {
        grid-template-columns: 1fr;
    }
    
    .wish-card-inner {
        padding: 1rem;
    }
}

/* 地图容器 */
#map-container {
    height: 400px;
    width: 100%;
    border-radius: var(--radius-lg);
    z-index: 1;
    margin-top: 2rem;
}

/* 成就徽章 */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.badge-item {
    text-align: center;
    padding: 1.2rem 1rem;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.badge-item.unlocked .badge-icon {
    animation: bounceIn 0.8s;
}

.gallery-story-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(232, 180, 184, 0.1);
}

.gallery-story-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

/* 照片悬停效果 */
.gallery-placeholder {
    position: relative;
    cursor: pointer;
}

/* 灯箱样式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.active {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

/* 灯箱信息区域 - 替代原来的 caption */
.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    text-align: center;
    z-index: 10;
}

.lightbox-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lightbox-meta {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.3rem;
}

.lightbox-date {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lightbox-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.5rem;
    line-height: 1.5;
    display: none;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   编辑模态框
   ========================================= */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.edit-modal.active {
    opacity: 1;
}

.edit-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.edit-modal.active .edit-modal-content {
    transform: scale(1) translateY(0);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.edit-modal-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
}

.edit-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.edit-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.edit-modal-body {
    margin-bottom: 1.5rem;
}

.edit-modal-body .form-group {
    margin-bottom: 1.5rem;
}

.edit-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-cancel-edit {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
}

/* 编辑照片预览 */
.edit-photo-preview {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: #f5f5f5;
}

.edit-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-photo-replace {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.edit-replace-preview {
    position: relative;
    width: 100%;
    max-height: 150px;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 2px dashed var(--primary-light);
}

.edit-replace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-replace-preview .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-save-edit {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-save-edit.loading .btn-text {
    opacity: 0;
}

.btn-save-edit .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-save-edit.loading .btn-spinner {
    display: block;
}

/* 响应式编辑模态框 */
@media (max-width: 768px) {
    .edit-modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .edit-modal-title {
        font-size: 1.1rem;
    }
    
    .edit-modal-actions {
        flex-direction: column;
    }
    
    .btn-cancel-edit,
    .btn-save-edit {
        width: 100%;
    }
}

.empty-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 4rem 2rem;
    font-size: 1.1rem;
    line-height: 2;
}

.empty-message::before {
    content: '💌';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

/* =========================================
   长按/右键弹出菜单
   ========================================= */
.context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 160px;
    z-index: 10000;
    display: none;
    animation: scaleIn 0.2s ease-out;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    -webkit-user-select: none;
    user-select: none;
}

.context-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.context-menu-item.danger {
    color: #e53e3e;
}

.context-menu-item.danger:hover {
    background: rgba(245, 101, 101, 0.1);
}

.context-menu-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.3rem 0;
}

/* =========================================
   消息提示
   ========================================= */
.success-message {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: #2f855a;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: #c53030;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    text-align: center;
    animation: shake 0.4s ease-in-out;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 骨架屏占位符 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.skeleton-image {
    width: 100%;
    padding-top: 75%;
    border-radius: 0;
}

.skeleton-text {
    height: 16px;
    margin: 12px 16px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin: 16px 16px 8px;
}

/* 时间轴骨架屏 */
.skeleton-timeline {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 60px;
}

@media (max-width: 768px) {
    .skeleton-timeline {
        padding-left: 60px;
        padding-right: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* =========================================
   动画系统
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 新增动画效果 */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(232, 180, 184, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(232, 180, 184, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 180, 184, 0); }
}

.highlight-pulse {
    animation: highlightPulse 1.5s infinite;
    border: 2px solid var(--primary);
}

/* =========================================
   响应式适配 - 优化版本
   ========================================= */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 150px;
        height: 100vh;
        background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 90px 0.5rem 2rem;
        gap: 0.15rem;
        box-shadow: -10px 0 40px rgba(102, 126, 234, 0.15);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        overflow-y: auto;
        /* 移动端性能优化 */
        will-change: transform;
        backface-visibility: hidden;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    /* 菜单项动画 - 依次淡入 */
    .nav-menu li {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-menu.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.25s; }

    /* 菜单项样式优化 */
    .nav-menu a {
        font-size: 0.82rem;
        font-weight: 500;
        padding: 0.35rem 0.6rem;
        width: 100%;
        border-radius: 10px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        letter-spacing: 0.3px;
    }

    .nav-menu a:hover {
        background: rgba(102, 126, 234, 0.08);
        color: var(--primary);
        transform: translateX(4px);
        padding: 0.4rem 0.9rem;
    }

    .nav-menu a.active {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%) !important;
        color: var(--primary) !important;
        font-weight: 600;
        text-shadow: none !important;
        box-shadow: none !important;
        padding: 0.35rem 0.9rem !important;
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-container {
        gap: 0.8rem;
    }
    
    .timer-item {
        min-width: 70px;
        padding: 1rem;
    }
    
    .timer-number {
        font-size: 1.8rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 60px;
        text-align: left !important;
    }
    
    .timeline-dot {
        left: 10px !important;
        right: auto !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 1rem;
    }
    
    .mood-chart-container {
        padding: 1rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-info {
        padding: 1rem;
    }
    
    .lightbox-title {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    
    .lightbox-meta {
        font-size: 0.85rem;
    }
    
    .lightbox-desc {
        font-size: 0.85rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* 移动端上传表单优化 */
    .upload-form-container .upload-form {
        width: 95%;
        max-width: 500px;
        padding: 1.5rem;
        max-height: 85vh;
        margin: 0 auto;
    }

    .story-form-container .story-form {
        width: 95%;
        padding: 1.5rem;
    }
    
    .upload-dropzone {
        padding: 2rem 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit {
        order: 1;
    }
    
    .btn-outline {
        order: 2;
    }
    
    /* 确保在移动设备上有足够的触摸目标 */
    .close-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }
    
    .remove-image {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    

}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .gallery-item {
        margin-bottom: 0;
    }
    
    .gallery-caption {
        padding: 0.8rem;
    }
    
    .gallery-caption h4 {
        font-size: 0.95rem;
    }
    
    .gallery-caption p {
        font-size: 0.8rem;
    }
    

    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }

    .story-form-container .story-form {
        padding: 1.5rem 1.2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .lightbox-content img {
        max-height: 70vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: 0.5rem;
    }
    
    /* 小屏幕动画优化 - 减少动画以提升性能 */
    .timeline-item,
    .gallery-item {
        animation-duration: 0.4s;
    }
    
    /* 触摸设备优化 */
    .btn,
    .fab-btn,
    .back-to-top {
        min-height: 44px;
        min-width: 44px;
    }
}

/* =========================================
   自定义确认对话框
   ========================================= */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal.active {
    opacity: 1;
}

.confirm-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.confirm-modal.active .confirm-modal-content {
    transform: scale(1) translateY(0);
}

.confirm-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.confirm-modal-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.confirm-modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
}

.confirm-modal-actions .btn-cancel {
    background: var(--accent-light);
    color: var(--text-secondary);
}

.confirm-modal-actions .btn-cancel:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.confirm-modal-actions .btn-confirm {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
}

.confirm-modal-actions .btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(238, 90, 111, 0.4);
}

.confirm-modal-actions .btn-confirm:active {
    transform: translateY(0);
}

/* =========================================
   认证弹窗样式
   ========================================= */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
}

.auth-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.auth-modal.active .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-modal-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.auth-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
    outline: none;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 180, 184, 0.2);
}

.auth-error {
    color: #ee5a6f;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    animation: shake 0.3s ease-in-out;
}

.auth-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.auth-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
}

.auth-actions .btn-cancel-auth {
    background: var(--accent-light);
    color: var(--text-secondary);
}

.auth-actions .btn-cancel-auth:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.auth-actions .btn-login {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(232, 180, 184, 0.3);
}

.auth-actions .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 180, 184, 0.4);
}

.auth-actions .btn-logout {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
}

.auth-actions .btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(238, 90, 111, 0.4);
}

/* 成功提示 */
.auth-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: white;
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.auth-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 90vw;
    border: 1px solid rgba(255,255,255,0.3);
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message.toast-success {
    border-left: 4px solid #48bb78;
}

.toast-message.toast-success .toast-icon {
    color: #48bb78;
}

.toast-message.toast-error {
    border-left: 4px solid #f56565;
}

.toast-message.toast-error .toast-icon {
    color: #f56565;
}

.toast-message.toast-info {
    border-left: 4px solid #4299e1;
}

.toast-message.toast-info .toast-icon {
    color: #4299e1;
}

.toast-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
}

.toast-text {
    flex: 1;
}
