/* ============ CSS变量 & 主题 ============ */
:root {
    --bg: #f0f7ff;
    --bg-card: #ffffff;
    --bg-sidebar: #f5f9ff;
    --text: #2d4a5a;
    --text-secondary: #6b8a9e;
    --border: #c8dff0;
    --primary: #4a90d9;
    --primary-hover: #357abd;
    --danger: #e74c3c;
    --shadow: 0 2px 12px rgba(74,144,217,0.1);
    --radius: 16px;
    --transition: 0.3s ease;
    --mood-happy: #ff6b6b;
    --mood-calm: #74b9ff;
    --mood-sad: #a29bfe;
    --mood-angry: #fd79a8;
    --mood-anxious: #fdcb6e;
    --mood-excited: #00cec9;
    --mood-tired: #a0aab4;
    --mood-moved: #ff9ff3;
    --mood-hopeful: #feca57;
    --mood-confused: #c8d6e5;
    --mood-grateful: #55efc4;
    --mood-bored: #8395a7;
}

/* 浅粉 */
[data-theme="pink"] {
    --bg: #fff0f5; --bg-card: #ffffff; --bg-sidebar: #fff5f8;
    --text: #5a3d5c; --text-secondary: #9b7a9e; --border: #f0d0e0;
    --primary: #e84393; --primary-hover: #d63082;
    --shadow: 0 2px 12px rgba(232,67,147,0.1);
}

/* 深色模式 */
[data-theme="dark"] {
    --bg: #1a1a2e; --bg-card: #16213e; --bg-sidebar: #0f3460;
    --text: #e0e0e0; --text-secondary: #a0a0a0; --border: #2a2a4a;
    --primary: #a29bfe; --primary-hover: #8e7cc3;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* 暖橘 */
[data-theme="warm"] {
    --bg: #fef9ef; --bg-card: #fff8e7; --bg-sidebar: #fff3d6;
    --text: #5d4037; --text-secondary: #8d6e63; --border: #ffe0b2;
    --primary: #e67e22; --primary-hover: #d35400;
    --shadow: 0 2px 12px rgba(139,90,43,0.1);
}

/* 莫兰迪 */
[data-theme="morandi"] {
    --bg: #e8e4e1; --bg-card: #f0ece9; --bg-sidebar: #dcd5d0;
    --text: #5a5a5a; --text-secondary: #8a8a8a; --border: #c8c0b8;
    --primary: #b8a9c9; --primary-hover: #a08db5;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* 薄荷绿 */
[data-theme="mint"] {
    --bg: #f0faf5; --bg-card: #ffffff; --bg-sidebar: #f5fcf8;
    --text: #2d5a3d; --text-secondary: #6b9e7a; --border: #c8e6c9;
    --primary: #26a69a; --primary-hover: #00897b;
    --shadow: 0 2px 12px rgba(38,166,154,0.1);
}

/* 薰衣草紫 */
[data-theme="lavender"] {
    --bg: #f5f0ff; --bg-card: #ffffff; --bg-sidebar: #faf7ff;
    --text: #4a3d5c; --text-secondary: #8b7a9e; --border: #d8d0f0;
    --primary: #7c5ce7; --primary-hover: #6344d3;
    --shadow: 0 2px 12px rgba(124,92,231,0.1);
}

/* 天空蓝 */
[data-theme="sky"] {
    --bg: #f0f7ff; --bg-card: #ffffff; --bg-sidebar: #f5f9ff;
    --text: #2d4a5a; --text-secondary: #6b8a9e; --border: #c8dff0;
    --primary: #4a90d9; --primary-hover: #357abd;
    --shadow: 0 2px 12px rgba(74,144,217,0.1);
}

/* 奶茶色 */
[data-theme="milktea"] {
    --bg: #fdf5e6; --bg-card: #fffdf7; --bg-sidebar: #faf3e8;
    --text: #5c4a3a; --text-secondary: #9b8878; --border: #e8d5c0;
    --primary: #c9956b; --primary-hover: #b07d52;
    --shadow: 0 2px 12px rgba(201,149,107,0.1);
}

/* ============ 基础重置 ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'LXGW WenKai', 'PingFang SC', 'Microsoft YaHei', serif;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    overflow: hidden;
    height: 100vh;
}

/* ============ 欢迎页 ============ */
.welcome-screen {
    position: fixed; inset: 0; z-index: 10000;
    background: #ffffff;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.8s ease;
}
.welcome-screen.hidden { display: none; }
.welcome-content {
    text-align: center; padding: 40px;
    display: flex; flex-direction: column; align-items: center;
}
.welcome-img {
    max-width: 420px; width: 90vw; height: auto;
    border-radius: 24px; margin-bottom: 24px;
    filter: drop-shadow(0 8px 24px rgba(74,144,217,0.15));
}
.welcome-cover-img {
    max-width: 500px; width: 85vw; height: auto;
    margin-bottom: 32px;
    animation: coverFloat 3s ease-in-out infinite;
}
@keyframes coverFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.welcome-title {
    font-size: 36px; font-weight: 700;
    background: linear-gradient(135deg, #4a90d9, #74b9ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 8px;
    letter-spacing: 4px;
}
.welcome-subtitle {
    font-size: 16px; color: #6b8a9e; margin-bottom: 32px;
    letter-spacing: 2px;
}
.btn-welcome {
    background: linear-gradient(135deg, #4a90d9, #74b9ff);
    color: white; padding: 14px 48px; border-radius: 30px;
    font-size: 16px; font-weight: 600; border: none;
    cursor: pointer; box-shadow: 0 4px 16px rgba(74,144,217,0.3);
    transition: all 0.3s ease;
}
.btn-welcome:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 24px rgba(74,144,217,0.4);
}

/* ============ 锁屏 ============ */
.lock-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.lock-screen.hidden { display: none; }
.lock-bg {
    position: absolute; inset: 0; z-index: 0;
    display: flex; align-items: center; justify-content: center;
    background: #ffffff;
}
.lock-bg-img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.85;
}
.lock-card {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.92); border-radius: 20px;
    padding: 40px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 360px;
    backdrop-filter: blur(8px);
}
.lock-icon { font-size: 60px; margin-bottom: 16px; }
.lock-card h2 { color: #2d3436; margin-bottom: 20px; font-size: 22px; }
.lock-card input {
    width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0;
    border-radius: 10px; font-size: 20px; text-align: center;
    letter-spacing: 8px; outline: none; transition: border-color 0.3s;
}
.lock-card input:focus { border-color: #e84393; }
.lock-dots { margin: 12px 0; display: flex; justify-content: center; gap: 8px; }
.lock-dots .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #e0e0e0; transition: background 0.3s;
}
.lock-dots .dot.filled { background: #e84393; }
.lock-hint { color: #b2bec3; font-size: 13px; margin: 12px 0; }
.lock-error { color: #e74c3c; font-size: 14px; margin-top: 8px; min-height: 20px; }

/* ============ 布局 ============ */
.app {
    display: flex; height: 100vh; overflow: hidden;
}

/* ============ 侧边栏 ============ */
.sidebar {
    width: 240px; min-width: 240px;
    background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: all var(--transition);
    overflow-y: auto;
}
.sidebar.collapsed { width: 60px; min-width: 60px; }
.sidebar.collapsed .nav-item > span:not(.nav-icon),
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-header h1 { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 14px; }
.sidebar.collapsed .nav-icon { margin-right: 0; font-size: 22px; }

.sidebar-header {
    padding: 20px; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--border);
}
.sidebar-header h1 { font-size: 18px; font-weight: 700; }
.sidebar-toggle {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--text); padding: 4px;
}

/* 侧边栏个人资料 */
.sidebar-profile {
    display: flex; flex-direction: column; align-items: center;
    padding: 16px 12px 12px; gap: 8px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.sidebar.collapsed .sidebar-profile { padding: 8px; gap: 4px; }
.sidebar.collapsed .sidebar-nickname { font-size: 9px; }
.sidebar-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    overflow: hidden; border: 3px solid var(--primary);
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); flex-shrink: 0;
}
.sidebar.collapsed .sidebar-avatar { width: 36px; height: 36px; border-width: 2px; }
.sidebar-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.sidebar-avatar-placeholder {
    font-size: 36px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.sidebar.collapsed .sidebar-avatar-placeholder { font-size: 20px; }
.sidebar-nickname {
    font-size: 14px; font-weight: 700; color: var(--text);
    text-align: center; max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    transition: all var(--transition);
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
    display: flex; align-items: center; padding: 12px 20px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 15px; transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-item:hover { background: rgba(108,92,231,0.08); color: var(--text); }
.nav-item.active {
    background: rgba(108,92,231,0.12); color: var(--primary);
    border-left-color: var(--primary); font-weight: 600;
}
.nav-icon { margin-right: 12px; font-size: 18px; }

.sidebar-footer {
    padding: 12px 16px; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 8px;
}
.sidebar-current-nb {
    font-size: 11px; color: var(--text-secondary);
    text-align: center; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.streak-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white; padding: 8px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600; text-align: center;
}

/* ============ 主内容 ============ */
.main-content {
    flex: 1; overflow-y: auto; padding: 30px;
    background: var(--bg); transition: background var(--transition);
}

.page { display: none; }
.page.active { display: block; }
.page h2 { font-size: 24px; margin-bottom: 24px; color: var(--text); }
.nb-page-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 8px;
    padding: 2px 10px;
    background: rgba(108,92,231,0.08);
    border-radius: 12px;
}

/* ============ 按钮 ============ */
.btn {
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 14px; cursor: pointer; font-weight: 600;
    transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #ffe0e0; color: var(--danger); border: 1px solid #ffcccc; }
.btn-danger:hover { background: #ffcccc; }

/* ============ 心情选择 ============ */
.mood-selector { margin-bottom: 20px; }
.mood-selector label { font-size: 15px; margin-bottom: 10px; display: block; color: var(--text-secondary); }
.mood-options { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); 
    gap: 10px; 
}
.mood-btn {
    font-size: 28px; background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 14px; padding: 10px 6px; cursor: pointer;
    transition: all 0.3s ease; line-height: 1;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    position: relative; overflow: hidden;
}
.mood-btn .mood-label {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    pointer-events: none;
}
.mood-btn:hover { 
    transform: translateY(-3px); 
    border-color: var(--primary); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.mood-btn.selected { 
    border-color: var(--primary); 
    background: rgba(108,92,231,0.08); 
    box-shadow: 0 4px 16px rgba(108,92,231,0.2);
}

/* ============ 每种心情的独特动画 ============ */
/* 开心 - 弹跳 */
@keyframes moodHappy { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-10px); } 60% { transform: translateY(-4px); } 80% { transform: translateY(-8px); } }
.mood-btn[data-mood="happy"]:hover,
.mood-btn[data-mood="happy"].selected { animation: moodHappy 0.45s ease infinite; border-color: #ff6b6b; background: rgba(255,107,107,0.1); }

/* 兴奋 - 旋转缩放爆发 */
@keyframes moodExcited { 0%,100% { transform: scale(1) rotate(0deg); } 30% { transform: scale(1.18) rotate(6deg); } 60% { transform: scale(1.05) rotate(-3deg); } 80% { transform: scale(1.12) rotate(2deg); } }
.mood-btn[data-mood="excited"]:hover,
.mood-btn[data-mood="excited"].selected { animation: moodExcited 0.5s ease infinite; border-color: #00cec9; background: rgba(0,206,201,0.1); }

/* 期待 - 星星缓缓上升 */
@keyframes moodHopeful { 0%,100% { transform: translateY(0); filter: brightness(1); } 50% { transform: translateY(-8px); filter: brightness(1.2); } }
.mood-btn[data-mood="hopeful"]:hover,
.mood-btn[data-mood="hopeful"].selected { animation: moodHopeful 0.8s ease-in-out infinite; border-color: #feca57; background: rgba(254,202,87,0.15); }

/* 感恩 - 温柔旋转发光 */
@keyframes moodGrateful { 0%,100% { transform: rotate(0deg) scale(1); } 40% { transform: rotate(3deg) scale(1.08); } 70% { transform: rotate(-2deg) scale(1.06); } }
.mood-btn[data-mood="grateful"]:hover,
.mood-btn[data-mood="grateful"].selected { animation: moodGrateful 1.2s ease infinite; border-color: #55efc4; background: rgba(85,239,196,0.12); }

/* 感动 - 心跳 */
@keyframes moodMoved { 0%,100% { transform: scale(1); } 10% { transform: scale(1.15); } 20% { transform: scale(0.95); } 30% { transform: scale(1.1); } 40% { transform: scale(0.97); } }
.mood-btn[data-mood="moved"]:hover,
.mood-btn[data-mood="moved"].selected { animation: moodMoved 0.6s ease infinite; border-color: #ff9ff3; background: rgba(255,159,243,0.1); }

/* 平静 - 轻柔呼吸 */
@keyframes moodCalm { 0%,100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }
.mood-btn[data-mood="calm"]:hover,
.mood-btn[data-mood="calm"].selected { animation: moodCalm 2.2s ease-in-out infinite; border-color: #74b9ff; background: rgba(116,185,255,0.1); }

/* 困惑 - 歪头 */
@keyframes moodConfused { 0%,100% { transform: rotate(0deg); } 20% { transform: rotate(6deg); } 50% { transform: rotate(-2deg); } 70% { transform: rotate(4deg); } 90% { transform: rotate(-1deg); } }
.mood-btn[data-mood="confused"]:hover,
.mood-btn[data-mood="confused"].selected { animation: moodConfused 0.7s ease infinite; border-color: #c8d6e5; background: rgba(200,214,229,0.15); }

/* 疲惫 - 打哈欠（下拉+模糊） */
@keyframes moodTired { 0%,100% { transform: scale(1); filter: blur(0); } 50% { transform: scale(0.9) translateY(3px); filter: blur(0.5px); } }
.mood-btn[data-mood="tired"]:hover,
.mood-btn[data-mood="tired"].selected { animation: moodTired 1s ease-in-out infinite; border-color: #a0aab4; background: rgba(160,170,180,0.12); }

/* 无聊 - 慢眨眼 */
@keyframes moodBored { 0%,100% { transform: scaleY(1); } 40% { transform: scaleY(0.85); } 60% { transform: scaleY(1); } 80% { transform: scaleY(0.9); } }
.mood-btn[data-mood="bored"]:hover,
.mood-btn[data-mood="bored"].selected { animation: moodBored 1.5s ease-in-out infinite; border-color: #8395a7; background: rgba(131,149,167,0.12); }

/* 焦虑 - 快速颤抖 */
@keyframes moodAnxious { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
.mood-btn[data-mood="anxious"]:hover,
.mood-btn[data-mood="anxious"].selected { animation: moodAnxious 0.35s ease infinite; border-color: #fdcb6e; background: rgba(253,203,110,0.15); }

/* 难过 - 轻轻下坠 */
@keyframes moodSad { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(5px); opacity: 0.7; } }
.mood-btn[data-mood="sad"]:hover,
.mood-btn[data-mood="sad"].selected { animation: moodSad 0.9s ease-in-out infinite; border-color: #a29bfe; background: rgba(162,155,254,0.1); }

/* 生气 - 愤怒抖动+变红 */
@keyframes moodAngry { 0%,100% { transform: translateX(0) scale(1); } 15% { transform: translateX(-4px) scale(1.06); } 30% { transform: translateX(4px) scale(1.04); } 45% { transform: translateX(-3px) scale(1.07); } 60% { transform: translateX(3px) scale(1.03); } 75% { transform: translateX(-2px) scale(1.05); } }
.mood-btn[data-mood="angry"]:hover,
.mood-btn[data-mood="angry"].selected { animation: moodAngry 0.4s ease infinite; border-color: #fd79a8; background: rgba(253,121,168,0.1); }

/* ============ 日记输入 ============ */
.diary-title-input {
    width: 100%; padding: 14px; border: 2px solid var(--border);
    border-radius: var(--radius); font-size: 18px; margin-bottom: 12px;
    background: var(--bg-card); color: var(--text);
    outline: none; transition: border-color 0.3s;
}
.diary-title-input:focus { border-color: var(--primary); }
.diary-content-input {
    width: 100%; height: 280px; padding: 16px;
    border: 2px solid var(--border); border-radius: var(--radius);
    font-size: 15px; resize: vertical; line-height: 1.8;
    background: var(--bg-card); color: var(--text);
    outline: none; transition: border-color 0.3s;
    font-family: inherit;
}
.diary-content-input:focus { border-color: var(--primary); }

/* ============ 标签系统 ============ */
.tag-input-area {
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.tag-input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-top: 8px;
}
.tag-input-wrapper {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    min-height: 42px;
    align-items: center;
    transition: border-color 0.3s;
}
.tag-input-wrapper:focus-within {
    border-color: var(--primary);
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    animation: tagPopIn 0.2s ease;
    cursor: default;
}
.tag-badge .tag-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: 2px;
}
.tag-badge .tag-remove:hover {
    opacity: 1;
}
@keyframes tagPopIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.tag-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--text);
    padding: 4px 0;
    font-family: inherit;
}
.tag-suggestions {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.tag-suggestions.show {
    display: flex;
}
.tag-suggestion-btn {
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.tag-suggestion-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108,92,231,0.06);
}

/* 列表中的标签筛选栏 */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.tag-filter-btn {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.tag-filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.tag-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.tag-filter-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 4px;
}

/* 日记卡片中的标签 */
.diary-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.diary-card-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(108,92,231,0.08);
    color: var(--primary);
    border: 1px solid rgba(108,92,231,0.15);
    cursor: pointer;
    transition: all 0.2s;
}
.diary-card-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 响应式下标签 */
@media (max-width: 768px) {
    .tag-input-area {
        flex-direction: column;
        gap: 6px;
    }
    .tag-input-label {
        padding-top: 0;
    }
}
.diary-image-area { margin: 12px 0; }
.diary-image-preview {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.diary-image-preview .img-wrap {
    position: relative; width: 90px; height: 90px;
}
.diary-image-preview .img-wrap img {
    width: 90px; height: 90px; object-fit: cover;
    border-radius: 12px; border: 2px solid var(--border);
    cursor: pointer; transition: transform 0.2s;
}
.diary-image-preview .img-wrap img:hover { transform: scale(1.03); }
.diary-image-preview .img-wrap .img-del {
    position: absolute; top: -6px; right: -6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--danger); color: white; border: none;
    font-size: 12px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.diary-image-upload {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border: 2px dashed var(--border);
    border-radius: var(--radius); color: var(--text-secondary);
    cursor: pointer; transition: all 0.3s; font-size: 14px;
    background: var(--bg-card);
}
.diary-image-upload:hover {
    border-color: var(--primary); color: var(--primary);
}
.diary-card-images {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.diary-card-images img {
    width: 85px; height: 85px; object-fit: cover;
    border-radius: 10px; border: 2px solid var(--border);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.diary-card-images img:hover {
    transform: scale(1.06);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.diary-actions {
    display: flex; justify-content: space-between;
    align-items: center; margin-top: 16px;
}
.auto-save-hint { color: #27ae60; font-size: 13px; opacity: 0; transition: opacity 0.3s; }
.auto-save-hint.show { opacity: 1; }
.diary-date { color: var(--text-secondary); font-size: 13px; margin-top: 8px; text-align: right; }

/* ============ 日记列表 ============ */
.list-toolbar {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.list-toolbar input, .list-toolbar select {
    padding: 10px 14px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none;
    background: var(--bg-card); color: var(--text);
}
.list-toolbar input { flex: 1; min-width: 200px; }
.list-toolbar input:focus, .list-toolbar select:focus { border-color: var(--primary); }

.diary-list { display: flex; flex-direction: column; gap: 12px; }
.diary-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
    border-left: 5px solid var(--primary); transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
/* 左侧色条根据心情变色 */
.diary-card[data-mood="happy"]    { border-left-color: #ff6b6b; }
.diary-card[data-mood="excited"]  { border-left-color: #00cec9; }
.diary-card[data-mood="hopeful"]  { border-left-color: #feca57; }
.diary-card[data-mood="grateful"] { border-left-color: #55efc4; }
.diary-card[data-mood="moved"]    { border-left-color: #ff9ff3; }
.diary-card[data-mood="calm"]     { border-left-color: #74b9ff; }
.diary-card[data-mood="confused"] { border-left-color: #c8d6e5; }
.diary-card[data-mood="tired"]    { border-left-color: #a0aab4; }
.diary-card[data-mood="bored"]    { border-left-color: #8395a7; }
.diary-card[data-mood="anxious"]  { border-left-color: #fdcb6e; }
.diary-card[data-mood="sad"]      { border-left-color: #a29bfe; }
.diary-card[data-mood="angry"]    { border-left-color: #fd79a8; }

.diary-card:hover { transform: translateX(4px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.diary-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.diary-card-mood { font-size: 28px; }
.diary-card-title { font-size: 17px; font-weight: 600; }
.diary-card-preview { color: var(--text-secondary); font-size: 14px; line-height: 1.6;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.diary-card-date { color: var(--text-secondary); font-size: 12px; }
.diary-card-actions { display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state p { margin: 8px 0; font-size: 15px; }

/* ============ 情绪日历 ============ */
.calendar-header {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-bottom: 20px;
}
.cal-month-label { font-size: 18px; font-weight: 600; min-width: 140px; text-align: center; }
.calendar-legend { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.legend-color { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend-empty { font-size: 13px; color: var(--text-secondary); }
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 6px; max-width: 700px; margin: 0 auto;
}
.calendar-day {
    aspect-ratio: 1; border-radius: 8px; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer; font-weight: 500;
    background: var(--bg-card); border: 1px solid var(--border);
    transition: all 0.2s; position: relative;
}
.calendar-day:hover { transform: scale(1.1); z-index: 2; }
.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { border: 2px solid var(--primary); font-weight: 700; background: rgba(74,144,217,0.08); }
.calendar-day.has-diary { border-color: var(--primary); background: rgba(74,144,217,0.04); }
.cal-day-num { font-size: 13px; font-weight: 500; line-height: 1; }
.cal-day-mood { font-size: 18px; line-height: 1; margin-top: 2px; }
.calendar-day-label {
    font-size: 12px; color: var(--text-secondary); font-weight: 600;
    text-align: center; padding: 8px 0; background: none;
}
.calendar-tooltip {
    position: fixed; background: #2d3436; color: white;
    padding: 8px 14px; border-radius: 8px; font-size: 13px;
    pointer-events: none; z-index: 100; display: none;
    white-space: nowrap;
}

/* ============ 情绪分析 ============ */
.stats-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card-small {
    padding: 18px 12px; text-align: center;
    background: var(--bg-card); border-radius: 12px;
    box-shadow: var(--shadow);
}
.stat-card-small .stat-value { font-size: 26px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
    min-height: 300px;
}
.stat-card h3 { font-size: 16px; margin-bottom: 16px; color: var(--text); }
.stat-card canvas { max-height: 260px; }

/* 大屏：3列布局，图表更大更清晰 */
@media (min-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .stat-card { min-height: 340px; padding: 28px; }
    .stat-card canvas { max-height: 300px; }
}
.stat-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-item { text-align: center; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); display: block; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* 心情热力分布 */
.mood-heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; margin: 0 auto; min-height: 200px; align-content: start; }
.heatmap-cell {
    aspect-ratio: 1; border-radius: 4px; display: flex;
    align-items: center; justify-content: center;
    font-size: 10px; cursor: pointer; transition: transform 0.15s;
    background: var(--border); color: var(--text-secondary);
}
.heatmap-cell:hover { transform: scale(1.15); z-index: 2; }
.heatmap-cell.active { color: white; font-weight: 700; }
.heatmap-label {
    font-size: 9px; color: var(--text-secondary); text-align: center; padding: 2px 0;
}

@media (max-width: 768px) {
    .stats-overview { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============ 治愈空间 ============ */
.heal-section {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.heal-section h3 { font-size: 18px; margin-bottom: 12px; }
.heal-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }

/* 每日语录 - 独立区块更紧凑 */
.heal-quote-section {
    margin-bottom: 16px;
}

/* Tab 切换栏 */
.heal-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.heal-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    white-space: nowrap;
}
.heal-tab-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}
.heal-tab-btn:hover {
    color: var(--text);
    background: rgba(108,92,231,0.06);
}
.heal-tab-btn:hover .heal-tab-icon {
    transform: scale(1.15);
}
.heal-tab-btn.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(74,144,217,0.3);
}
.heal-tab-btn.active .heal-tab-icon {
    animation: tabIconBounce 0.5s ease;
}
@keyframes tabIconBounce {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.2); }
    60% { transform: scale(0.95); }
    80% { transform: scale(1.08); }
}

/* Tab 面板 */
.heal-tab-panels {
    position: relative;
}
.heal-tab-panel {
    display: none;
    animation: healFadeSlide 0.35s ease;
}
.heal-tab-panel.active {
    display: block;
}
@keyframes healFadeSlide {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.quote-card {
    background: linear-gradient(135deg, rgba(108,92,231,0.1), rgba(253,121,168,0.1));
    padding: 24px; border-radius: var(--radius); text-align: center;
}
.quote-text { font-size: 18px; line-height: 1.8; font-style: italic; margin-bottom: 12px; }

/* 呼吸练习 */
.breath-container {
    display: flex; justify-content: center; margin: 24px 0;
}
.breath-circle {
    width: 180px; height: 180px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a29bfe);
    display: flex; align-items: center; justify-content: center;
    transition: transform 4s ease-in-out;
    box-shadow: 0 0 40px rgba(108,92,231,0.3);
}
.breath-circle.inhale { transform: scale(1.4); }
.breath-circle.hold { transform: scale(1.4); }
.breath-circle.exhale { transform: scale(1); }
.breath-text { color: white; font-size: 20px; font-weight: 600; }
.breath-controls { text-align: center; }
.breath-info { color: var(--text-secondary); font-size: 13px; margin-top: 12px; }
.breath-controls .btn { margin: 4px; }

/* 白噪音 */
.sound-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sound-card {
    background: var(--bg); border: 2px solid var(--border);
    border-radius: var(--radius); padding: 20px; text-align: center;
    cursor: pointer; transition: all 0.2s; display: flex;
    flex-direction: column; align-items: center; gap: 8px;
}
.sound-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.sound-card.playing { border-color: var(--primary); background: rgba(108,92,231,0.1); }
.sound-icon { font-size: 32px; }
.sound-name { font-size: 14px; font-weight: 600; }
.sound-controls { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.now-playing { font-size: 14px; color: var(--primary); font-weight: 600; }
.volume-slider { flex: 1; accent-color: var(--primary); }

/* ============ 切水果解压游戏 ============ */
.fruit-stats {
    display: flex; justify-content: center; gap: 32px;
    margin-bottom: 12px; font-size: 14px; color: var(--text-secondary);
}
.fruit-stats strong { color: var(--primary); font-size: 18px; }
.fruit-canvas {
    display: block; margin: 0 auto 12px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #e8f4fd 0%, #f0f7ff 40%, #fafeff 100%);
    box-shadow: var(--shadow); max-width: 100%;
    cursor: crosshair; touch-action: none;
}
.fruit-controls { display: flex; justify-content: center; }

@media (max-width: 768px) {
    .fruit-stats { gap: 16px; font-size: 13px; }
    .fruit-stats strong { font-size: 16px; }
}

/* ============ 树洞 ============ */
.treehole-desc { color: var(--text-secondary); margin-bottom: 20px; }
.treehole-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn {
    padding: 10px 20px; border: 2px solid var(--border);
    border-radius: 8px; background: var(--bg-card); cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    transition: all 0.2s;
}
.tab-btn.active { border-color: var(--primary); color: var(--primary); background: rgba(108,92,231,0.08); }
.treehole-tab { display: none; }
.treehole-tab.active { display: block; }
.treehole-input {
    width: 100%; height: 180px; padding: 16px; border: 2px solid var(--border);
    border-radius: var(--radius); font-size: 15px; resize: vertical;
    background: var(--bg-card); color: var(--text); outline: none;
    font-family: inherit; line-height: 1.8; margin-bottom: 16px;
}
.treehole-input:focus { border-color: var(--primary); }

.drift-bottle { text-align: center; padding: 40px; }
.bottle-icon { font-size: 80px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.bottle-content {
    background: var(--bg-card); padding: 24px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 16px;
}
.bottle-text { font-size: 16px; line-height: 1.8; margin-bottom: 12px; }
.bottle-time { color: var(--text-secondary); font-size: 12px; }
.bottle-actions { display: flex; gap: 8px; margin-top: 12px; }
.reply-box { margin-top: 16px; }
.reply-box textarea {
    width: 100%; height: 80px; padding: 12px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 14px; resize: vertical;
    background: var(--bg-card); color: var(--text); outline: none;
    font-family: inherit; margin-bottom: 8px;
}
.my-treeholes { display: flex; flex-direction: column; gap: 12px; }
.treehole-card {
    background: var(--bg-card); padding: 16px; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.treehole-card .reply-text {
    background: rgba(108,92,231,0.06); padding: 10px; border-radius: 8px;
    margin-top: 8px; font-size: 14px; font-style: italic;
}

/* ============ 成就 ============ */
.achievements-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.achievement-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 20px; text-align: center; box-shadow: var(--shadow);
    transition: all 0.2s;
}
.achievement-card.unlocked { border: 2px solid #ffd700; }
.achievement-card.locked { opacity: 0.5; filter: grayscale(1); }
.achievement-icon { font-size: 40px; margin-bottom: 8px; }
.achievement-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.achievement-desc { font-size: 12px; color: var(--text-secondary); }

/* ============ 设置 ============ */
.settings-section {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.settings-section h3 { font-size: 16px; margin-bottom: 14px; }

/* 个人资料编辑 */
.profile-editor {
    display: flex; flex-direction: column; gap: 16px;
}
.profile-avatar-editor {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.avatar-preview {
    width: 80px; height: 80px; border-radius: 50%;
    overflow: hidden; border: 3px solid var(--primary);
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.avatar-preview img {
    width: 100%; height: 100%; object-fit: cover;
}
.avatar-preview .avatar-placeholder {
    font-size: 44px; display: flex; align-items: center; justify-content: center;
}
.avatar-actions {
    display: flex; flex-direction: column; gap: 8px;
}
.avatar-upload-btn {
    cursor: pointer; position: relative;
}
.profile-nickname-editor {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.profile-nickname-editor label {
    font-size: 14px; font-weight: 600; color: var(--text);
}
.profile-nickname-editor .settings-input {
    flex: 1; max-width: 240px;
}
.profile-info-tip {
    font-size: 12px; color: var(--text-secondary);
}

.theme-options { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 12px 20px; border: 2px solid var(--border);
    border-radius: var(--radius); background: var(--bg-card);
    cursor: pointer; font-size: 13px; font-weight: 600;
    color: var(--text); transition: all 0.2s;
}
.theme-btn.active { border-color: var(--primary); background: rgba(232,67,147,0.06); }
.theme-preview { width: 40px; height: 40px; border-radius: 8px; display: block; }
.pink-preview { background: linear-gradient(135deg, #fff0f5, #fecfef); }
.lavender-preview { background: linear-gradient(135deg, #f5f0ff, #d8d0f0); }
.sky-preview { background: linear-gradient(135deg, #f0f7ff, #c8dff0); }
.mint-preview { background: linear-gradient(135deg, #f0faf5, #c8e6c9); }
.warm-preview { background: linear-gradient(135deg, #fef9ef, #ffeaa7); }
.milktea-preview { background: linear-gradient(135deg, #fdf5e6, #e8d5c0); }
.morandi-preview { background: linear-gradient(135deg, #e8e4e1, #c8b6a6); }
.dark-preview { background: linear-gradient(135deg, #1a1a2e, #16213e); }

.font-size-slider { width: 200px; accent-color: var(--primary); vertical-align: middle; }
#fontSizeLabel { margin-left: 10px; font-weight: 600; }

.switch-label {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.switch {
    width: 48px; height: 26px; background: #ccc;
    border-radius: 13px; position: relative; transition: background 0.3s;
}
.switch::after {
    content: ''; width: 22px; height: 22px; background: white;
    border-radius: 50%; position: absolute; top: 2px; left: 2px;
    transition: transform 0.3s;
}
.switch-label input { display: none; }
.switch-label input:checked + .switch { background: var(--primary); }
.switch-label input:checked + .switch::after { transform: translateX(22px); }

.settings-input {
    padding: 8px 12px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none;
    background: var(--bg-card); color: var(--text); width: 180px;
}
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar { width: 60px; min-width: 60px; }
    .sidebar .nav-item span:not(.nav-icon),
    .sidebar .sidebar-footer,
    .sidebar .sidebar-header h1 { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 14px; }
    .sidebar .nav-icon { margin-right: 0; font-size: 22px; }
    .main-content { padding: 16px; }
    .sound-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
    .mood-options { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .mood-btn { font-size: 24px; padding: 8px 4px; }
    .mood-btn .mood-label { font-size: 10px; }
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============ 陪伴玩偶 ============ */
.companion-doll {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.doll-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #f0f7e8, #d4edc9);
    box-shadow: 0 6px 24px rgba(76,175,80,0.2), inset 0 2px 8px rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}
.doll-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(76,175,80,0.3), inset 0 2px 8px rgba(255,255,255,0.8);
}
.doll-avatar:active {
    transform: scale(0.95);
}
.doll-face {
    font-size: 44px;
    transition: all 0.3s ease;
    line-height: 1;
}
.doll-face-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    border-radius: 50%;
    transition: all 0.3s ease;
}
/* 玩偶弹跳动画 */
@keyframes dollBounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-14px); }
    50% { transform: translateY(-6px); }
    70% { transform: translateY(-10px); }
}
.doll-avatar.bouncing .doll-face {
    animation: dollFaceBounce 0.5s ease;
}
@keyframes dollFaceBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.25); }
    50% { transform: scale(0.9); }
    70% { transform: scale(1.15); }
}

/* 对话框气泡 */
.doll-bubble {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 18px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    max-width: 260px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.doll-bubble.show {
    opacity: 1;
    transform: translateY(0);
}
.doll-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--bg-card);
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    border-radius: 0 0 4px 0;
}
/* 祝贺气泡 - 金色边框 */
.doll-bubble.congrats {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fffef0, #fff9e0);
    box-shadow: 0 4px 20px rgba(255,215,0,0.2);
}
.doll-bubble.congrats::after {
    border-right-color: #ffd700;
    border-bottom-color: #ffd700;
    background: #fffef0;
}

/* 星星粒子 */
.doll-sparkles {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}
.doll-sparkle {
    position: absolute;
    font-size: 16px;
    animation: sparkleFly 1s ease-out forwards;
    opacity: 0;
}
@keyframes sparkleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(0); }
    50% { opacity: 1; transform: translate(var(--sx), var(--sy)) scale(1.2); }
    100% { opacity: 0; transform: translate(var(--ex), var(--ey)) scale(0.4); }
}

/* 玩偶名字 */
.doll-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* 玩偶不同状态的表情颜色 - 龙猫森林主题 */
.doll-avatar.state-happy { background: linear-gradient(135deg, #fff, #f0ffe0, #d4f5c0); }
.doll-avatar.state-calm { background: linear-gradient(135deg, #fff, #e8f5e9, #c8e6c9); }
.doll-avatar.state-tired { background: linear-gradient(135deg, #fff, #f5f5f0, #e8e8dc); }
.doll-avatar.state-excited { background: linear-gradient(135deg, #fff, #fff9c4, #ffe082); }
.doll-avatar.state-moved { background: linear-gradient(135deg, #fff, #fef0ff, #e8d5f5); }
.doll-avatar.state-sad { background: linear-gradient(135deg, #fff, #e0e8f0, #c8d6e5); }

/* 响应式 */
@media (max-width: 768px) {
    .companion-doll {
        margin-top: 24px;
    }
    .doll-avatar {
        width: 72px;
        height: 72px;
    }
    .doll-face {
        font-size: 36px;
    }
    .doll-bubble {
        max-width: 220px;
        font-size: 13px;
        padding: 8px 14px;
    }
}

/* ============ 拍立得弹出 - 日系便签风 ============ */
.polaroid-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(6px);
}
.polaroid-overlay.show {
    opacity: 1; pointer-events: auto;
}
.polaroid-card {
    background: #fdfaf3;
    padding: 22px 20px 18px;
    box-shadow: 2px 4px 24px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
    border-radius: 8px;
    max-width: 370px;
    width: 88vw;
    transform: rotate(-1.5deg) scale(0.7);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
}
.polaroid-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 42px;
    width: 100px;
    height: 18px;
    background: rgba(245, 230, 211, 0.8);
    border-radius: 2px;
    transform: rotate(-6deg);
    box-shadow: 1px 1px 2px rgba(0,0,0,0.06);
    z-index: 1;
}
.polaroid-card::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 42px;
    width: 100px;
    height: 18px;
    background: rgba(245, 230, 211, 0.8);
    border-radius: 2px;
    transform: rotate(4deg);
    box-shadow: 1px 1px 2px rgba(0,0,0,0.06);
    z-index: 1;
}
.polaroid-overlay.show .polaroid-card {
    transform: rotate(0deg) scale(1);
}
.polaroid-photo {
    background: #fffef9;
    border: 1px solid rgba(180,160,140,0.25);
    border-radius: 4px;
    padding: 24px 22px 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
/* 第一排：左边日期 + 右边心情 */
.polaroid-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    animation: fadeInUp 0.4s ease 0.15s both;
}
.polaroid-date {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    text-align: left;
}
.polaroid-mood {
    font-size: 36px;
    line-height: 1;
    animation: moodPop 0.5s ease 0.2s both;
}
@keyframes moodPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
.polaroid-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: left;
    animation: fadeInUp 0.4s ease 0.3s both;
}
.polaroid-content {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    max-height: 180px;
    overflow-y: auto;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    animation: fadeInUp 0.4s ease 0.4s both;
}
.polaroid-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #a89888;
    margin-top: 14px;
    font-style: italic;
    letter-spacing: 1px;
    padding-top: 8px;
    border-top: 1px dashed rgba(180,160,140,0.25);
    position: relative;
}
.polaroid-bottom::before {
    content: '✎';
    position: absolute;
    right: 0;
    bottom: 20px;
    font-size: 10px;
    color: #c8b8a8;
    font-style: normal;
}
.polaroid-save-btn {
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 1px;
    padding: 5px 14px;
    border: 1.5px solid #c8b8a8;
    border-radius: 16px;
    background: #fffef9;
    color: #8c7b6b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.polaroid-save-btn:hover {
    border-color: #a89888;
    color: #6b5b4b;
    background: #f5efe5;
    box-shadow: 0 2px 8px rgba(160,140,120,0.15);
}
.polaroid-save-btn:active {
    transform: scale(0.96);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ 动画 ============ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: fadeIn 0.3s ease; }

/* ============ 那年今日 ============ */
.memory-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}
.memory-year-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.memory-year-btn {
    padding: 10px 24px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}
.memory-year-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.memory-year-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(108,92,231,0.3);
}
.memory-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.memory-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid #c8a96e;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c8a96e, #e8d5b7, #c8a96e);
    opacity: 0.5;
}
.memory-card:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.memory-card-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.memory-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.memory-card-mood {
    font-size: 32px;
    line-height: 1;
    animation: moodPop 0.5s ease both;
}
.memory-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.memory-card-date {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.memory-card-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}
.memory-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.memory-card-mood-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.memory-view-btn {
    font-weight: 600;
    transition: all 0.2s;
}
.memory-view-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 那年今日空状态 */
#memoryEmpty .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@media (max-width: 768px) {
    .memory-card {
        padding: 18px;
    }
    .memory-card-title {
        font-size: 15px;
    }
    .memory-year-btn {
        padding: 8px 18px;
        font-size: 13px;
    }
}

/* ============ 日记本切换器 ============ */
.notebook-switcher {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.sidebar.collapsed .notebook-switcher {
    display: none;
}
.nb-switcher-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.nb-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}
.nb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1.5px solid transparent;
}
.nb-item:hover {
    background: rgba(108,92,231,0.06);
    color: var(--text);
    border-color: var(--border);
}
.nb-item.active {
    background: rgba(108,92,231,0.1);
    color: var(--primary);
    font-weight: 600;
    border-color: var(--primary);
}
.nb-item.active .nb-count {
    background: var(--primary);
    color: #fff;
}
.nb-icon {
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.nb-item:hover .nb-icon {
    transform: scale(1.15);
}
.nb-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.nb-count {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}
.nb-delete {
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.nb-item:hover .nb-delete {
    opacity: 0.5;
}
.nb-item:hover .nb-delete:hover {
    opacity: 1;
    color: var(--danger);
    background: rgba(231,76,60,0.1);
}
.nb-add-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.nb-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108,92,231,0.04);
}

/* ============ 日记本创建弹窗 ============ */
.nb-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}
.nb-modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 28px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: fadeInUp 0.3s ease;
}
.nb-modal h3 {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
}
.nb-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 14px;
}
.nb-form label:first-child { margin-top: 0; }
.nb-form input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s;
}
.nb-form input:focus {
    border-color: var(--primary);
}
.nb-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nb-icon-option {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg);
}
.nb-icon-option:hover {
    border-color: var(--border);
    transform: scale(1.1);
    background: var(--bg-card);
}
.nb-icon-option.selected {
    border-color: var(--primary);
    background: rgba(108,92,231,0.1);
    box-shadow: 0 2px 8px rgba(108,92,231,0.15);
}
.nb-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}
.nb-form-actions .btn {
    min-width: 80px;
    justify-content: center;
}

/* 侧边栏收起时隐藏日记本信息 */
.sidebar.collapsed .sidebar-current-nb {
    display: none;
}

@media (max-width: 768px) {
    .nb-modal {
        padding: 20px;
    }
    .nb-icon-option {
        width: 36px; height: 36px;
        font-size: 20px;
    }
    .nb-list {
        max-height: 150px;
    }
}

/* ============ 图片灯箱 ============ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    cursor: default;
}
.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
}
.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.15);
}

/* ============ 写日记页 - 上传行 ============ */
.diary-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ OCR 按钮 ============ */
.diary-ocr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px dashed var(--primary);
    border-radius: 10px;
    background: var(--primary-light, #fff0f5);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}
.diary-ocr-btn:hover {
    background: var(--primary);
    color: #fff;
    border-style: solid;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}
.diary-ocr-btn:active {
    transform: scale(0.97);
}

/* ============ OCR 弹窗 ============ */
.ocr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.ocr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.ocr-modal {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    width: 90vw;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.ocr-modal-overlay.active .ocr-modal {
    transform: translateY(0);
}
.ocr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border, #eee);
}
.ocr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text, #333);
}
.ocr-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 26px;
    color: var(--text-secondary, #999);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.ocr-close:hover {
    background: var(--bg-hover, #f5f5f5);
    color: var(--text, #333);
}
.ocr-modal-body {
    padding: 20px 24px 24px;
}

/* 上传区域 */
.ocr-upload-zone {
    border: 2px dashed var(--border, #ddd);
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-input, #fafafa);
}
.ocr-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light, #fff0f5);
}
.ocr-upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.ocr-upload-zone p {
    margin: 4px 0;
    color: var(--text, #333);
    font-size: 15px;
    font-weight: 500;
}
.ocr-upload-hint {
    font-size: 13px !important;
    color: var(--text-secondary, #999) !important;
    font-weight: 400 !important;
}

/* 预览区域 */
.ocr-preview {
    text-align: center;
}
.ocr-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    border: 1px solid var(--border, #eee);
    object-fit: contain;
}
.ocr-preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

/* 进度条 */
.ocr-progress {
    text-align: center;
    padding: 20px 0;
}
.ocr-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input, #eee);
    border-radius: 4px;
    overflow: hidden;
}
.ocr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff9ff3);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}
.ocr-progress-text {
    margin-top: 12px;
    color: var(--text-secondary, #999);
    font-size: 13px;
}

/* 识别结果 */
.ocr-result-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #888);
    margin-bottom: 8px;
}
.ocr-result-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border, #ddd);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-input, #fafafa);
    color: var(--text, #333);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.ocr-result-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}
.ocr-result-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* 深色模式适配 */
.dark-mode .ocr-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.dark-mode .ocr-upload-zone {
    background: var(--bg-input);
    border-color: var(--border);
}
.dark-mode .ocr-upload-zone:hover {
    background: rgba(255, 107, 107, 0.08);
}
.dark-mode .ocr-progress-bar {
    background: var(--bg-input);
}
.dark-mode .ocr-result-textarea {
    background: var(--bg-input);
}

@media (max-width: 768px) {
    .ocr-modal {
        width: 95vw;
        max-height: 90vh;
        border-radius: 14px;
    }
    .ocr-modal-header {
        padding: 16px 18px 10px;
    }
    .ocr-modal-body {
        padding: 16px 18px 20px;
    }
    .ocr-upload-zone {
        padding: 30px 16px;
    }
    .ocr-result-actions {
        justify-content: stretch;
    }
    .ocr-result-actions .btn {
        flex: 1;
        text-align: center;
    }
}

/* ============ PWA 安装横幅 ============ */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-card, #fff);
    border-top: 1px solid var(--border, #eee);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* safe-area 适配 iPhone 底部 */
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.pwa-install-banner.show {
    transform: translateY(0);
}
.pwa-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}
.pwa-banner-text {
    flex: 1;
    min-width: 0;
}
.pwa-banner-text strong {
    display: block;
    font-size: 15px;
    color: var(--text, #333);
    margin-bottom: 2px;
}
.pwa-banner-text span {
    font-size: 12px;
    color: var(--text-secondary, #999);
}
.pwa-banner-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.pwa-banner-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}
.pwa-banner-btn:active {
    transform: scale(0.97);
}
.pwa-banner-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-secondary, #999);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    margin-left: -4px;
}
.pwa-banner-close:hover {
    background: var(--bg-hover, #f5f5f5);
    color: var(--text, #333);
}

/* PWA standalone 模式下隐藏安装横幅 */
@media (display-mode: standalone) {
    .pwa-install-banner {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .pwa-install-banner {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }
    .pwa-banner-icon {
        font-size: 28px;
    }
    .pwa-banner-text strong {
        font-size: 14px;
    }
}
