/* --- style.css 顶部 --- */

/* 1. 定义 Cinzel (Logo 字体) */
@font-face {
    font-family: 'Cinzel';
    src: url('fonts/Cinzel.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 2. 定义 Lato (正文英文) */
@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 3. 定义 Noto Sans SC (正文中文) */
@font-face {
    font-family: 'Noto Sans SC';
    src: url('fonts/NotoSansSC.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* 4. 定义 Ma Shan Zheng (书法字体) */
@font-face {
    font-family: 'Ma Shan Zheng';
    src: url('fonts/MaShanZheng.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- 下面保持你原有的 :root 和 body 设置 --- */
:root { 
    /* ... */
    --transition-speed: 2.5s; 
    --bg-start: #A0E6FF; --bg-end: #FFFACD;
    --celestial-start: #FFFFFF; --celestial-end: #FEF08A;
    --color-exercise: #ef4444; --color-sleep: #3b82f6; --color-focus: #10b981; --color-holiday: #22c55e; --color-diary: #f59e0b; --color-task: #eab308;
    --rail-x: 13rem; --current-beam-color: var(--color-diary);
    --base-font-size: 16px;
}
/* Global Font: Lato + Noto Sans SC */
body { 
    font-family: 'Lato', 'Noto Sans SC', sans-serif; 
    font-size: var(--base-font-size); 
    width: 100vw; 
    
    /* 核心修改：先写 100vh 兼容旧手机，再写 100dvh */
    height: 100vh; 
    height: 100dvh; 
    
    overflow: hidden; /* 禁止 body 滚动，只让内部容器滚动 */
    background: linear-gradient(to bottom, var(--bg-start), var(--bg-end)); 
    color: var(--text); 
    transition: background 1.5s ease, color 1s ease; 
}
/* Specific Logo Font */
.font-logo { font-family: 'Cinzel', serif; font-weight: 400; }

/* Themes */
body[data-theme="dawn"] { --text: #334155; --text-sec: #64748b; --primary: #fb7185; --line: rgba(0,0,0,0.08); --card-bg: rgba(255, 248, 248, 0.9); --card-border: rgba(255, 226, 226, 0.8); --card-shadow: 0 10px 30px -5px rgba(251, 113, 133, 0.1); --card-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.95); --rail-color: rgba(0, 0, 0, 0.08); --glow-color: rgba(251, 113, 133, 0.5); --hud-time-color: #F59E0B; }
body[data-theme="day"] { --text: #1e293b; --text-sec: #64748b; --primary: #f59e0b; --line: rgba(0,0,0,0.06); --card-bg: rgba(255, 255, 255, 0.85); --card-border: rgba(255, 255, 255, 0.9); --card-shadow: 0 10px 30px -5px rgba(69, 90, 100, 0.05); --card-highlight: inset 1px 1px 0 rgba(255, 255, 255, 1); --rail-color: rgba(0, 0, 0, 0.08); --glow-color: rgba(253, 224, 71, 0.6); --hud-time-color: #38BDF8; }
body[data-theme="dusk"] { --text: #f8fafc; --text-sec: #cbd5e1; --primary: #fbbf24; --line: rgba(255,255,255,0.15); --card-bg: rgba(45, 35, 80, 0.8); --card-border: rgba(251, 191, 36, 0.3); --card-shadow: 0 15px 40px -5px rgba(0, 0, 0, 0.4); --card-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.15); --rail-color: rgba(255, 255, 255, 0.15); --glow-color: rgba(251, 191, 36, 0.4); --hud-time-color: #EA580C; }
body[data-theme="night"] { --text: #f8fafc; --text-sec: #94a3b8; --primary: #818cf8; --line: rgba(255,255,255,0.1); --card-bg: rgba(15, 23, 42, 0.85); --card-border: rgba(148, 163, 184, 0.2); --card-shadow: 0 15px 40px -5px rgba(2, 6, 23, 0.6); --card-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.1); --rail-color: rgba(255, 255, 255, 0.1); --glow-color: rgba(99, 102, 241, 0.5); --hud-time-color: #818CF8; text-shadow: 0 0 15px #818CF8; }

/* --- Layout & HUD --- */
#world-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.orbit-wrapper { position: fixed; left: -30vh; bottom: -60vh; width: 140vh; height: 140vh; pointer-events: none; z-index: 0; display: flex; justify-content: center; align-items: center; }
.orbit-wheel { width: 100%; height: 100%; border-radius: 50%; position: relative; transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1); }
.celestial-body { width: 150px; height: 150px; border-radius: 50%; position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); transition: all 1s; }
.sun-body { background: radial-gradient(circle at 30% 30%, var(--celestial-start), var(--celestial-end)); box-shadow: 0 0 50px var(--celestial-end); }
.moon-body { top: 100%; background: transparent; transform: translate(-50%, -50%) rotate(180deg); }
.crescent-shape { width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 20px 5px 0 0 #fdf6e3; filter: drop-shadow(0 0 10px rgba(255,255,255,0.5)); }

.nav-capsule { display: flex; background: rgba(0,0,0,0.1); border-radius: 999px; padding: 4px; border: 1px solid var(--line); backdrop-filter: blur(5px); }
.nav-btn { padding: 12px 24px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; transition: all 0.3s; color: var(--text-sec); }
.nav-btn.active { background: var(--card-bg); color: var(--text); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transform: scale(1.05); }

#focus-hud { position: fixed; top: 50%; left: 1rem; width: 5rem; transform: translateY(-60%); z-index: 40; pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; transition: opacity 0.3s ease; }
.hud-day { font-size: 3rem; font-weight: 900; line-height: 0.9; color: var(--text); text-shadow: 0 0 30px var(--glow-color); mix-blend-mode: overlay; margin-bottom: 0.2rem; }
.hud-time-wrapper { display: flex; align-items: center; height: 1.5rem; }
.hud-time { font-size: 1.2rem; font-weight: 900; color: var(--hud-time-color); display: inline-block; transition: opacity 0.1s, transform 0.1s, color 1s; }
.hud-time-updating { opacity: 0; transform: translateY(5px); filter: blur(4px); }
.hud-meta { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-sec); opacity: 0.9; margin-top: 0.2rem; }

#center-guide-layer { position: fixed; top: 50%; left: 0; width: 100%; height: 0; z-index: 0; pointer-events: none; transform: translateY(-0.5px); transition: opacity 0.3s ease; }
/* Fixed Beam Logic */
.guide-beam { position: absolute; left: 7rem; width: calc(var(--rail-x) - 7rem); height: 2px; background-color: var(--current-beam-color); opacity: 0.5; top: 0; transform: translateY(-50%); transition: background-color 0.3s ease; pointer-events: none; }
.guide-cursor { position: absolute; left: var(--rail-x); top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--current-beam-color); transform: translate(-50%, -50%); box-shadow: 0 0 8px 1px var(--current-beam-color); transition: top 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s, box-shadow 0.3s; opacity: 1; z-index: 30; pointer-events: none; }

/* --- style.css --- */

.timeline-rail-outer { 
    /* 必须是 fixed */
    position: fixed; 
    left: 0; 
    top: 0; 
    
    /* 强制占满高度，防止变成“一段” */
    bottom: 0; 
    height: 100%; 
    height: 100dvh; /* 适配手机动态高度 */
    
    width: 100%; 
    pointer-events: none; 
    z-index: 1; /* 确保在背景之上，内容之下 */
    
    /* 如果之前修改过，保持只有边缘虚化 */
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
}.timeline-rail-container { position: absolute; left: var(--rail-x); top: 0; bottom: 0; width: 2px; transform: translateX(-50%); z-index: 1; }
.timeline-rail-line { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: linear-gradient(to bottom, transparent, var(--rail-color) 20%, var(--rail-color) 80%, transparent); }
.rail-center-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4px; height: 60px; background: var(--current-beam-color); opacity: 0.4; filter: blur(4px); transition: background 0.3s ease; pointer-events: none; border-radius: 99px; }
.timeline-rail-flow { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, transparent, var(--primary), transparent); background-size: 100% 500px; background-repeat: repeat-y; opacity: 0.3; animation: flowLight 6s linear infinite; }
@keyframes flowLight { 0% { background-position: 0 -500px; } 100% { background-position: 0 0; } }
.task-highlight-line { position: absolute; left: var(--rail-x); width: 3px; transform: translateX(-50%); z-index: 5; opacity: 0.8; border-radius: 99px; background-size: 200% 200%; animation: taskFlow 3s ease infinite; pointer-events: none; }
@keyframes taskFlow { 0% {background-position: 0% 50%} 50% {background-position: 100% 50%} 100% {background-position: 0% 50%} }
.task-line-label { position: absolute; font-weight: 700; font-size: 0.6rem; color: var(--text-sec); opacity: 0.7; white-space: nowrap; transform: translateX(-100%); left: -12px; }
.label-mid { top: 50%; transform: translate(-100%, -50%); color: var(--current-beam-color); font-weight: 900; opacity: 1; }
#main-container {
    position: fixed; /* 改为 fixed 确保稳固 */
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100%;       /* 兼容旧浏览器 */
    height: 100dvh;     /* 适配 iOS 动态状态栏 */
    overflow-y: scroll !important; /* 强制开启滚动条 */
    -webkit-overflow-scrolling: touch; /* 开启 iOS 惯性滚动 */
    z-index: 10;
    touch-action: pan-y; /* 允许垂直拖动 */
}
#diary-list {
    /* 保持原有的留白 */
    padding-top: 45vh;
    padding-bottom: 50vh;
    
    /* 【核心】强制最小高度为屏幕高度 + 1像素
       这样永远都能滑得动，永远有回弹，不会被系统锁死 */
    min-height: 101vh !important; 
    
    position: relative;
    z-index: 20;
    pointer-events: auto; /* 确保能接收触摸事件 */
}
.entry-item { 
    pointer-events: none; /* 让触摸穿透条目容器，直达列表背景 */
    position: relative; 
    width: 100%; 
    
    /* 配合容器的 proximity */
    scroll-snap-align: center; 
    
    /* 【核心修复】删除 scroll-snap-stop，防止快速滑动时被强制刹车 */
    /* scroll-snap-stop: always;  <-- 这行必须删掉 */
    
    display: flex; 
    align-items: center; 
    padding-block: 32px; 
    pointer-events: none; 
}
.timeline-node-wrapper { position: absolute; left: var(--rail-x); top: 50%; transform: translate(-50%, -50%); z-index: 21; pointer-events: none; }
.timeline-node { width: 6px; height: 6px; border-radius: 50%; background-color: #9ca3af; opacity: 0.6; transition: all 0.3s ease; }
.entry-item.active-focus .timeline-node { width: 14px; height: 14px; background-color: var(--node-active-color, var(--primary)); opacity: 1; transition: box-shadow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s, width 0.2s, height 0.2s; box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--node-active-color, var(--primary)); transform: scale(1);
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.6); /* 稍微加点边框高亮 */
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.15); /* 加深阴影 */
    z-index: 60; /* 浮在最上面 */ }
/* Tighter padding for cards */
.entry-card-wrapper { flex: 1; padding-left: calc(var(--rail-x) + 1rem); padding-right: 1rem; min-width: 0; transition: opacity 0.3s ease; pointer-events: auto; }

/* ENTRY CARD STYLE FIX: Default border is transparent/subtle */
.entry-card { background-color: var(--card-bg); border: 1px solid transparent; box-shadow: var(--card-shadow), var(--card-highlight); cursor: pointer; border-radius: 14px; backdrop-filter: blur(20px); display: flex; overflow: hidden; min-height: 90px; position: relative; pointer-events: auto; transform-origin: left center; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.4s ease, 
                border-color 0.3s, 
                box-shadow 0.3s;
    
    /* 默认缩小一点点，增加聚焦时的反差感 */
    transform: scale(0.96); 
    opacity: 0.7; 
}
.entry-card.selecting:hover { transform: scale(0.98); } 
/* Selected state has clear border, NO BG COLOR CHANGE */
.entry-card.selected { border: 2px solid var(--primary); box-shadow: 0 0 20px var(--primary); transform: scale(1.02); background-color: var(--card-bg);opacity: 1 !important;
    transform: scale(1) !important;
    border: 2px solid var(--primary); }

/* Data Archive List Item Style Fix */
.archive-item { border: 1px solid transparent; transition: all 0.2s; }
/* Selected Archive Item: Only border changes, text remains readable */
.archive-item.selected { border-color: var(--primary); background-color: rgba(255,255,255,0.1); }

.glow-purple { box-shadow: 0 0 25px rgba(168, 85, 247, 0.6); border-color: rgba(168, 85, 247, 0.5); animation: pulseGlow 3s infinite ease-in-out; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); } 50% { box-shadow: 0 0 35px rgba(168, 85, 247, 0.8); } 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); } }

/* FIX: FORCE POINTER EVENTS AND Z-INDEX FOR FLOATING BUTTONS */
#filter-fab-group, .fab-ai-btn, .fab-btn { 
    pointer-events: auto !important; 
    z-index: 200 !important; 
    cursor: pointer !important;
}

/* CRITICAL FIX: MODALS MUST BE HIGHER THAN BUTTONS (9999 > 200) */
.modal-overlay { z-index: 9998 !important; }
.modal-content { z-index: 9999 !important; }

#filter-fab-group { position: fixed; bottom: 100px; left: 24px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; transition: opacity 0.3s; }
.filter-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.filter-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); transition: all 0.3s; }
.f-anni.active { background-color: #fbbf24; border-color: transparent; box-shadow: 0 0 15px #fbbf24; transform: scale(1.2); }
.f-holiday.active { background-color: var(--color-holiday); border-color: transparent; box-shadow: 0 0 15px var(--color-holiday); transform: scale(1.2); }
.f-normal.active { background-color: #9ca3b8; border-color: transparent; box-shadow: 0 0 15px #9ca3b8; transform: scale(1.2); }
.filter-dot:not(.active) { background-color: transparent; border-color: rgba(255,255,255,0.5); opacity: 1; transform: scale(0.8); }
.filter-label { font-weight: 900; font-size: 0.65rem; letter-spacing: 0.1em; opacity: 1; transform: none; transition: all 0.3s; }
.label-anni { color: #fbbf24; } .label-holiday { color: var(--color-holiday); } .label-normal { color: #9ca3b8; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; } .stat-card { background: var(--card-bg); border: 1px solid var(--card-border); padding: 16px; border-radius: 16px; backdrop-filter: blur(20px); box-shadow: var(--card-shadow); display: flex; flex-direction: column; min-height: 120px; } .stat-value { font-size: 1.8rem; font-weight: 900; color: var(--text); margin-top: auto; margin-bottom: 8px; } .stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; } .stat-chart-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; } .stat-chart-fill { height: 100%; border-radius: 99px; width: 0%; transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1); }
.cal-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; gap: 4px; } 
.cal-bar-bg { width: 100%; background: var(--line); border-radius: 4px; flex: 1; position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: 0; }
.cal-bar-fill { width: 100%; background: orange; transition: height 1s ease; } 
.cal-bar-val { font-size: 0.6rem; font-weight: bold; color: var(--text); height: 14px; display: flex; items-center: center; } 
.cal-label { font-size: 0.6rem; color: var(--text-sec); font-weight: 700; height: 14px; display: flex; align-items: center; }

#gallery-grid-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-item { aspect-ratio: 1/1; position: relative; overflow: hidden; border-radius: 8px; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-date-header { grid-column: 1 / -1; font-weight: 900; font-size: 0.8rem; color: var(--text-sec); opacity: 0.8; margin-top: 1rem; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid var(--line); padding-bottom: 4px; }

/* AI Button Positioning */
.fab-ai-btn { bottom: 110px; }

@media (max-width: 640px) { 
    :root { --rail-x: 6rem; } 
    #focus-hud { left: 0.25rem; width: 3.5rem; } 
    .entry-card-wrapper { padding-left: calc(var(--rail-x) + 0.5rem); padding-right: 1rem; } 
    /* Mobile Beam: Starts at 4rem, width is remainder */
    .guide-beam { left: 4rem; width: calc(var(--rail-x) - 4rem); }
    /* Ensure Filter stays left on mobile */
    #filter-fab-group { bottom: 100px; left: 16px; right: auto !important; } 
}



.oracle-western { background: linear-gradient(135deg, #2b1055, #7597de); border-color: #a855f7; font-family: 'Cinzel', serif; }

.persona-btn { padding: 6px 12px; border-radius: 99px; font-size: 0.75rem; font-weight: bold; opacity: 0.6; transition: all 0.3s; border: 1px solid white; color: white; } .persona-btn.active { opacity: 1; background: white; color: black; }
.quick-task-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid; transition: all 0.2s; font-weight: 700; font-size: 0.7rem; white-space: nowrap; background: var(--card-bg); } .quick-task-btn:active { transform: scale(0.95); }
.todo-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); pointer-events: auto; cursor: pointer; } .todo-check { color: var(--primary); display: flex; align-items: center; justify-content: center; } .todo-text { font-size: 0.9rem; color: var(--text); } .todo-done { text-decoration: line-through; opacity: 0.5; }
.holiday-badge { color: #14532d; background: #86efac; } .card-holiday { border-left: 4px solid var(--color-holiday) !important; } .card-task { border-left: 4px solid var(--color-task) !important; } .task-end-btn { margin-top: 8px; padding: 4px 10px; font-size: 0.7rem; font-weight: bold; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s; border: 1px solid currentColor; background: rgba(255,255,255,0.5); z-index: 30; position: relative; pointer-events: auto; } .btn-end-Exercise { color: #b91c1c; } .btn-end-Sleep { color: #1d4ed8; } .btn-end-Focus { color: #047857; }
.card-thumb-col { width: 80px; flex-shrink: 0; border-right: 1px solid var(--line); display: block; aspect-ratio: 1/1; } .card-thumb-img { width: 100%; height: 100%; object-fit: cover; } .card-main-col { flex: 1; padding: 1rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; } .card-mood { position: absolute; top: 0.8rem; right: 0.8rem; color: var(--text-sec); opacity: 0.6; transform: scale(0.9); background: var(--line); padding: 4px; border-radius: 6px; } .anni-badge { display: inline-block; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-bottom: 6px; margin-right: 4px; width: fit-content; } .anni-future-badge { color: #713f12; background: rgba(253, 224, 71, 0.6); } .anni-past-badge { color: #1d4ed8; background: rgba(191, 219, 254, 0.5); } .list-placeholder { position: absolute; left: 0; right: 0; height: 100px; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; font-family: 'Cinzel', serif; text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.75rem; color: var(--text-sec); pointer-events: none; transition: opacity 0.5s ease; z-index: 5; } #future-placeholder { top: 20vh; } #origin-placeholder { bottom: 20vh; }
.block-btn { padding: 6px 10px; border-radius: 8px; background: var(--card-bg); color: var(--text); font-size: 0.75rem; font-weight: bold; white-space: nowrap; border: 1px solid transparent; transition: all 0.2s; display: flex; align-items: center; gap: 4px; } .block-btn:hover { background: var(--primary); color: white; }
#editor-content { white-space: pre-wrap; font-family: 'Lato', monospace; font-size: 1.05rem; line-height: 1.75; background: transparent; padding: 12px; border-radius: 8px; border: 1px solid transparent; color: var(--text); user-select: text; }
.hidden-view { display: none !important; } .active-view { display: block !important; animation: fadeIn 0.6s ease-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.calendar-cell { aspect-ratio: 1/1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.95rem; position: relative; color: var(--text); } .calendar-cell.current-day { border: 2px solid var(--primary); } 
.calendar-lunar { font-size: 0.5rem; opacity: 0.4; margin-top: -2px; }
.modal-content { background-color: var(--card-bg); backdrop-filter: blur(30px); border: 1px solid var(--line); z-index: 10000; transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1); }
.md-render h1 { font-size: 1.4em; font-weight: 800; margin: 0.5em 0 0.2em; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 4px; } .md-render p { margin-bottom: 0.5em; line-height: 1.5; font-size: 1.1em; } .md-render img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.simon-sig { font-family: 'Oswald', sans-serif; font-weight: 300; letter-spacing: 0.1em; opacity: 0.5; font-size: 0.7rem; text-align: center; margin-top: 2rem; color: var(--text-sec); }
.animate-pulse-slow { animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* FORCE HIDE UTILITY - Place at end to override ID selectors */
.hidden { display: none !important; }
/* --- Editor Preview Extensions --- */
#editor-preview {
    width: 100%;
    height: 30vh;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--line);
    color: var(--text);
    font-family: 'Lato', sans-serif;
    backdrop-filter: blur(10px);
}

/* 隐藏输入框 */
#editor-content.hidden-editor {
    display: none;
}

/* 按钮激活状态 */
#btn-preview-toggle.active {
    background-color: var(--card-bg);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}
/* --- 粘贴到 style.css 最底部 --- */

/* 预览框的基础样式 */
#editor-preview {
    width: 100%;
    height: 30vh;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 16px;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--line);
    color: var(--text);
    backdrop-filter: blur(10px);
    display: none; /* 默认隐藏 */
}

/* 激活预览时的样式 */
/* --- 粘贴到 style.css 最底部 --- */

/* 1. 预览框：模仿输入框的外观 */
#editor-preview {
    display: none;
    width: 100%;
    min-height: 30vh; /* 最小高度，防止内容太少时很难点到 */
    max-height: 50vh;
    overflow-y: auto;
    /* 背景和输入框保持一致，实现“无缝切换”错觉 */
    background-color: var(--card-bg); 
    padding: 12px; /* 和 textarea 的 p-3 (12px) 保持一致 */
    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    color: var(--text);
    cursor: text; /* 鼠标放上去是“输入”光标，暗示可编辑 */
}

/* 2. 激活时显示 */
#editor-preview.active-preview {
    display: block !important;
}

/* 3. 输入框：隐藏时彻底消失 */
#editor-content.hidden-editor {
    display: none !important;
}

/* --- Markdown 渲染样式 (标题变大) --- */
.md-render h1 { font-size: 1.6em; font-weight: 900; border-bottom: 2px solid var(--primary); margin: 0.5em 0; }
.md-render h2 { 
    font-size: 1.4em; 
    font-weight: 700; 
    border-left: 4px solid var(--primary); 
    padding-left: 8px; 
    margin: 0.8em 0 0.4em; 
    background: rgba(0,0,0,0.02); 
    color: var(--text);
}
.md-render p { margin-bottom: 0.8em; line-height: 1.6; }
.md-render ul { list-style-type: disc; padding-left: 20px; }
.md-render ol { list-style-type: decimal; padding-left: 20px; }
.md-render strong { color: var(--primary); font-weight: 900; }
.md-render blockquote { border-left: 3px solid #ccc; padding-left: 10px; color: #666; font-style: italic; }
#editor-content.hidden-editor {
    display: none;
}
#btn-preview-toggle.active {
    background-color: var(--primary);
}
#btn-preview-toggle.active i {
    color: white !important;
}

/* --- Markdown 渲染样式 (让 ## 变标题的关键) --- */
.md-render h1 { font-size: 1.6em; font-weight: 900; border-bottom: 2px solid var(--primary); margin: 0.5em 0; }
.md-render h2 { font-size: 1.4em; font-weight: 700; border-left: 4px solid var(--primary); padding-left: 8px; margin: 0.8em 0 0.4em; background: rgba(0,0,0,0.02); }
.md-render h3 { font-size: 1.2em; font-weight: 700; margin: 0.5em 0; }
.md-render p { margin-bottom: 0.8em; line-height: 1.6; }
.md-render ul { list-style-type: disc; padding-left: 20px; margin-bottom: 1em; }
.md-render ol { list-style-type: decimal; padding-left: 20px; margin-bottom: 1em; }
.md-render blockquote { border-left: 3px solid #ccc; padding-left: 10px; color: #666; font-style: italic; margin: 10px 0; }
.md-render strong { color: var(--primary); font-weight: 900; }

/* --- 粘贴到 style.css 底部 --- */

/* 限制文内图片和视频的最大尺寸，防止撑爆屏幕 */
.md-render img, 
.md-render video {
    max-width: 90%;       /* 宽度最多占 90% */
    max-height: 400px;    /* 高度最多 400px */
    border-radius: 8px;   /* 圆角 */
    margin: 10px auto;    /* 上下留空，居中 */
    display: block;       /* 独占一行 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* 加点阴影好看 */
}
/* --- 编辑器图片样式 --- */
#editor-content img {
    max-width: 90% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 隐藏旧的预览区域相关的样式，防止干扰 */
#image-preview-area { display: none !important; }

/* --- 编辑器 UI 重构 (模块化设计) --- */

/* 1. 工具栏按钮的基础样式 */
.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-sec);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 鼠标悬停 */
.tool-btn:hover {
    background-color: var(--line);
    color: var(--text);
    transform: translateY(-1px); /* 轻微上浮 */
}

/* 点击按下 */
.tool-btn:active {
    transform: scale(0.95);
}

/* 2. 心情/天气按钮选中状态 */
/* 这会让选中的按钮变成实心色块，且有阴影 */
.mood-btn.bg-\[var\(--primary\)\] { /* JS添加类名后的兼容 */
    background-color: var(--primary) !important;
    box-shadow: 0 4px 12px var(--glow-color);
    transform: scale(1.1);
}
.weather-btn.bg-\[var\(--primary\)\] {
    background-color: var(--text) !important; /* 天气选中用深色 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: scale(1.1);
}
.weather-btn.bg-\[var\(--primary\)\] i {
    color: var(--card-bg) !important;
}

/* 3. 编辑器内图片美化 */
#editor-content img {
    max-width: 90% !important;
    height: auto !important;
    border-radius: 12px; /* 更圆润 */
    margin: 20px auto;   /* 居中且留白 */
    display: block;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); /* 悬浮感阴影 */
    transition: transform 0.3s;
}
#editor-content img:hover {
    transform: scale(1.01);
}
/* 放在 style.css 底部，强制让 Logo 更细更优雅 */
.font-logo {
    font-family: 'Cinzel', serif;
    font-weight: 400; /* Cinzel 最细就是 400，如果不满意可以换成 Lato 100 */
}
/* --- Oracle/Weekly Summary Modal Styles --- */

/* 1. 神秘紫色背景 (类似 Info 页面的 Oracle 卡片) */
.oracle-theme-bg {
    background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #0f172a 100%);
    color: white;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
}

/* 2. 角色选择按钮 (默认半透明，激活变实心白) */
.oracle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.oracle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* 激活状态 (JS 添加 .active 类) */
.oracle-btn.active {
    background: white !important;
    color: #4c1d95 !important; /* 深紫色文字 */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    border-color: white;
    transform: scale(1.05);
    font-weight: 800;
}

/* 3. 输入框在深色背景下的样式 */
.oracle-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}
.oracle-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(168, 85, 247, 0.8);
}
.oracle-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 4. 结果区域样式 */
/* 4. 结果区域样式 (修改版：微带紫调的护眼色) */
.oracle-result-box {
    /* 极淡的紫底，护眼且有质感 */
    background: rgba(250, 248, 255, 0.98);
    color: #3b0764; /* 很深的紫色字，比纯黑更有温度 */
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.8);
    border-radius: 12px;
    padding: 24px; /* 增加内边距，呼吸感 */
    font-family: 'Noto Sans SC', 'Lato', sans-serif;
}

/* 标题 (##)：改为柔和的分隔标题 */
.oracle-result-box h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #6b21a8; /* 紫色 */
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.3); /* 虚线分割，像信纸的横线 */
    padding-bottom: 4px;
    letter-spacing: 0.05em;
}

/* 标题 (###)：备用，更小一点 */
.oracle-result-box h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #7e22ce;
    margin-top: 1rem;
}

/* 正文段落：增加行高，易于阅读 */
.oracle-result-box p {
    font-size: 0.95rem;
    line-height: 1.8; /* 1.8倍行高，非常易读 */
    margin-bottom: 1rem;
    opacity: 0.9;
    text-align: justify; /* 两端对齐 */
}

/* 重点强调 (Bold)：高亮 */
.oracle-result-box strong {
    color: #9333ea;
    font-weight: 900;
    background: rgba(147, 51, 234, 0.05); /* 淡淡的背景高亮 */
    padding: 0 2px;
    border-radius: 2px;
}

/* 列表：柔和的缩进 */
.oracle-result-box ul {
    list-style: none; /* 去掉默认圆点 */
    padding-left: 0;
    margin: 1rem 0;
}

.oracle-result-box li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 自定义列表圆点 */
.oracle-result-box li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: #a855f7;
    font-size: 0.8rem;
    top: 2px;
}

/* --- Timeline 悬浮按钮 (扁平磨砂版) --- */
.fab-glass {
    position: fixed;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* --- 风格统一修正 --- */
    /* 去掉原本的 radial-gradient 高光 */
    background: rgba(255, 255, 255, 0.8); /* 默认亮色，适应日间模式 */
    border: 1px solid rgba(255, 255, 255, 0.6);
    
    /* 增加磨砂感 */
    backdrop-filter: blur(8px);
    
    /* 柔和阴影 */
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.15);
}

/* 紫色按钮 (AI) */
.fab-glass-purple {
    bottom: 110px;
    /* 淡淡的紫色背景，不刺眼 */
    background: rgba(243, 232, 255, 0.85); 
    color: #7e22ce; /* 紫色图标 */
    border-color: rgba(216, 180, 254, 0.5);
}

/* 琥珀色按钮 (写日记) */
.fab-glass-amber {
    bottom: 2rem;
    background: rgba(254, 252, 232, 0.9); 
    color: #d97706; /* 琥珀色图标 */
    border-color: rgba(253, 230, 138, 0.5);
}

/* 暗黑模式适配 (如果 body 有 data-theme="night" 或 "dusk") */
body[data-theme="night"] .fab-glass,
body[data-theme="dusk"] .fab-glass {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.5);
}
body[data-theme="night"] .fab-glass-purple {
    color: #d8b4fe; /* 夜间紫色变亮 */
    background: rgba(88, 28, 135, 0.4);
}
body[data-theme="night"] .fab-glass-amber {
    color: #fcd34d; /* 夜间黄色变亮 */
    background: rgba(120, 53, 15, 0.4);
}

/* 悬停效果：简单的上浮和光晕 */
.fab-glass:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.2);
}
.fab-glass-purple:hover {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    background: rgba(243, 232, 255, 1);
}
.fab-glass-amber:hover {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    background: rgba(255, 251, 235, 1);
}
/* 1. 修复数据管理列表无法点击的问题 */
.archive-item { 
    /* 原本可能是 transparent border 等... */
    border: 1px solid transparent; 
    transition: all 0.2s; 
    pointer-events: auto !important; /* 【关键修复】强制开启点击事件 */
    cursor: pointer;
}
/* 3. 确保 AI 按钮和写日记按钮层级正确，不被遮挡 */
#btn-ai-summary, .fab-btn, #filter-fab-group {
    z-index: 60 !important;
    pointer-events: auto !important;
}

/* 4. 详情页 Markdown 图片样式 (如果之前觉得图片太小/太乱) */
#detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
/* --- style.css 底部添加 --- */
@media (max-width: 640px) {
    /* 手机端禁用卡片毛玻璃，改用纯色半透明，大幅提升滚动FPS */
    .entry-card, .nav-capsule, #focus-hud, .modal-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    /* 稍微增加背景不透明度作为补偿 */
    body[data-theme="day"] .entry-card { background-color: rgba(255, 255, 255, 0.95); }
    body[data-theme="night"] .entry-card { background-color: rgba(15, 23, 42, 0.95); }
}
/* --- 粘贴到 style.css 最底部 --- */

/* 1. 编辑器顶部类型切换 (Diary/Routine/Anni) */
.active-type {
    background-color: var(--card-bg);
    color: var(--text);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    opacity: 1 !important;
}

/* 2. 元数据胶囊 (日期/时间/卡路里) */
.meta-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--line);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Noto Sans SC', sans-serif;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.meta-pill:hover {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 3. 快速追踪按钮 (运动/睡眠/专注/冥想) */
.track-btn {
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    transition: all 0.2s;
    background: var(--card-bg);
    border: 1px solid var(--line);
    color: var(--text-sec);
}
.track-btn:hover {
    transform: translateY(-2px);
}
/* 激活状态：背景变成对应颜色，文字变白 */
.track-btn.active {
    background: currentColor; /* 妙用：背景色自动跟随文字颜色 */
    color: white !important;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
/* 电脑端变成横向排列，更节省空间 */
@media (min-width: 640px) {
    .track-btn { flex-direction: row; }
}
/* --- 粘贴到 style.css 最底部 --- */

/* Tab 基础样式重置 */
#type-diary, #type-task, #type-anni {
    opacity: 0.6;
    transition: all 0.2s;
}

/* 1. Diary (日记) - 浅蓝色 */
#type-diary.active-type {
    background-color: #e0f2fe; /* Sky-100 */
    color: #0284c7;            /* Sky-600 */
    opacity: 1;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.1);
}

/* 2. Routine (习惯) - 红色 */
#type-task.active-type {
    background-color: #fee2e2; /* Red-100 */
    color: #dc2626;            /* Red-600 */
    opacity: 1;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

/* 3. Anniversary (纪念日) - 金色 */
#type-anni.active-type {
    background-color: #fef3c7; /* Amber-100 */
    color: #d97706;            /* Amber-600 */
    opacity: 1;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.1);
}

/* 4. Track 按钮微调 (点击感更强) */
.track-btn:active {
    transform: scale(0.95);
}
/* --- style.css --- */

.entry-card { 
    background-color: var(--card-bg); 
    border: 1px solid transparent; 
    box-shadow: var(--card-shadow), var(--card-highlight); 
    cursor: pointer; 
    border-radius: 14px; 
    backdrop-filter: blur(20px); 
    display: flex; 
    overflow: hidden; 
    min-height: 90px; 
    position: relative; 
    transform-origin: left center; 
    transition: transform 0.2s linear, border-color 0.3s; 
    z-index: 50; 
    margin-right: 1rem; 
    
    /* 【核心修复】加上 !important，强制允许点击 */
    pointer-events: auto !important; 
}
/* --- 粘贴到 style.css 底部 --- */
/* --- style.css 底部 --- */
.card-today-highlight {
    border: 2px solid var(--primary) !important; /* 强制边框颜色 */
    box-shadow: 0 0 20px var(--glow-color) !important; /* 发光 */
    animation: todayPulse 3s infinite ease-in-out; /* 呼吸动画 */
}

@keyframes todayPulse {
    0% { box-shadow: 0 0 10px var(--glow-color); transform: scale(1); }
    50% { box-shadow: 0 0 25px var(--glow-color); transform: scale(1.02); }
    100% { box-shadow: 0 0 10px var(--glow-color); transform: scale(1); }
}

/* 2. 日历：小圆点样式修复 */
.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--text-sec); /* 默认灰色 */
    margin-top: 4px;
    opacity: 0.6;
}

/* 3. 日历：今天的小圆点 (特别颜色) */
.cal-dot-today {
    background-color: #ef4444 !important; /* 鲜艳的红色 */
    width: 6px;
    height: 6px;
    opacity: 1;
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* 辅助：确保日历格子内容垂直居中 */
.calendar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* 在 style.css 中找到 .entry-item */
.entry-item {
    /* ... 保持原有样式 ... */
    
    /* 【新增】内容可见性优化：
       告诉浏览器，如果这个元素不在屏幕上，就别费劲去渲染它的内容了。
       这能极大地降低内存占用和滚动卡顿。 */
    content-visibility: auto; 
    contain-intrinsic-size: 150px; /* 给个大致的高度估算值，防止滚动条跳动 */
}
.entry-card, .fab-btn, #filter-fab-group, #btn-ai-summary {
    pointer-events: auto !important; /* 只有卡片和按钮可以点击 */
}

/* 4. 修复时间轴线的定位，防止遮挡 */
.timeline-rail-outer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    pointer-events: none !important; /* 绝对禁止它拦截触摸 */
    z-index: 0; /* 放在最底层 */
}

/* 高亮闪烁动画 (用于跳转设置时提示) */
@keyframes flashHighlight {
    0% { background-color: rgba(245, 158, 11, 0); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    30% { background-color: rgba(245, 158, 11, 0.2); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3); transform: scale(1.02); }
    100% { background-color: rgba(245, 158, 11, 0); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); transform: scale(1); }
}

.flash-highlight {
    animation: flashHighlight 1.5s ease-out;
    border-color: var(--primary) !important;
    border-radius: 12px;
}

/* 优化仪表盘卡片的点击感 */
.stat-card {
    /* 增加过渡效果 */
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none; /* 防止点击时选中文本 */
}
.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
/* --- Paywall Animations --- */

/* 1. 悬浮动画 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* 2. 流光扫过动画 (用于 Max 卡片) */
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
.group:hover .group-hover\:animate-shimmer {
    animation: shimmer 1.5s infinite;
}

/* 3. 脉冲辉光 */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}
.animate-pulse-slow {
    animation: pulseGlow 4s ease-in-out infinite;
}
/* --- 极致慢速动画 (仪式感) --- */

/* 1. 超慢速旋转 (星体运转) */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-super-slow {
    animation: spin 10s linear infinite; /* 10秒转一圈，极慢 */
}

/* 2. 慢速扫描进度条 (呼吸感) */
.animate-loading-scan {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 99px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    /* 改为 4s，更加悠长 */
    animation: loading-scan 4s infinite ease-in-out;
}

/* --- 灵能宝石 (Purple Gem) --- */
.gem-icon {
    background: linear-gradient(135deg, #e9d5ff 0%, #a855f7 50%, #581c87 100%);
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.5), /* 顶部高光 */
        inset 0 -2px 4px rgba(0,0,0,0.3), /* 底部阴影 */
        0 0 20px rgba(168, 85, 247, 0.6); /* 外部发光 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.gem-text-glow {
    color: #e9d5ff;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
}

/* 交易流水滚动列表 */
.transaction-list {
    max-height: 150px;
    overflow-y: auto;
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    scrollbar-width: none; /* 隐藏滚动条 */
}
.transaction-list::-webkit-scrollbar { display: none; }

.trans-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.2);
    font-size: 10px;
    color: #e9d5ff;
}
.trans-positive { color: #34d399; font-weight: bold; } /* 绿色加分 */
.trans-negative { color: #f472b6; font-weight: bold; } /* 粉色扣分 */

/* --- 🛠️ 最终修正版：去红存灰 + 完美选中逻辑 --- */

/* 1. 全局强制重置：未选中的卡片必须“安静”且“灰暗” */
.entry-card {
    opacity: 0.5 !important;
    transform: scale(0.95) !important;
    
    /* 默认给一个极淡的透明/灰色边框，或者直接透明 */
    border-color: transparent !important; 
    
    box-shadow: none !important;
    animation: none !important; /* 禁止呼吸 */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    will-change: transform, opacity, box-shadow;
}

/* =========================================
   2. 选中状态 (Active Focus) 的基础样式
   ========================================= */
.entry-item.active-focus .entry-card {
    opacity: 1 !important;
    transform: scale(1.02) !important; /* 选中变大 */
    z-index: 50;
    
    /* 默认选中样式：主题色边框 + 光晕 */
    border: 1px solid var(--primary) !important; 
    box-shadow: 0 0 25px var(--glow-color) !important;
    background-color: var(--card-bg) !important;
}

/* =========================================
   3. 特殊状态修复 (解决红色残留问题)
   ========================================= */

/* 修复 A: 今日高亮 (Today Highlight) */
/* 只有被选中时 -> 红色呼吸 + 红色框 */
.entry-item.active-focus .card-today-highlight {
    animation: todayPulse 3s infinite ease-in-out !important;
    border: 2px solid #ef4444 !important; /* 鲜艳红 */
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
}

/* 【关键修改】未选中时 -> 灰色框 (不再是红色) */
.card-today-highlight {
    border-color: rgba(156, 163, 175, 0.3) !important; /* 低调的灰色 */
}


/* 修复 B: 紫色心情 (Glow Purple) */
/* 只有被选中时 -> 紫色呼吸 */
.entry-item.active-focus .glow-purple {
    animation: pulseGlow 3s infinite ease-in-out !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.6) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
}
/* 未选中时 -> 强制无色/灰色，防止紫色残留 */
.glow-purple {
    border-color: transparent !important;
}


/* =========================================
   4. 夜间模式蓝光增强 (仅针对选中)
   ========================================= */
body[data-theme="night"] .entry-item.active-focus .entry-card {
    box-shadow: 0 0 35px rgba(129, 140, 248, 0.6) !important; 
    border-color: #818cf8 !important;
}


@media (hover: none) {
    .entry-card:hover {
        opacity: 0.5 !important;
        transform: scale(0.95) !important;
        box-shadow: none !important;
        animation: none !important;
        border-color: transparent !important; /* 防止滑动时变色 */
    }
    
    /* 针对今天的特殊卡片，滑动时保持灰色，别变红 */
    .card-today-highlight:hover {
        border-color: rgba(156, 163, 175, 0.3) !important;
    }
}

@media (max-width: 640px) {
    
    :root { 
        /* 保持轨道位置，这是卡片对齐的基准 */
        --rail-x: 4.5rem !important; 
        --base-font-size: 15px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
        overflow-x: hidden;
    }

    /* --- 1. HUD：回归左侧纵向堆叠 (Timeline Time Axis) --- */
    #focus-hud {
        position: fixed !important;
        
        /* 【核心修复】位置：回归左侧边缘，不依赖轨道线 */
        left: 0.5rem !important; 
        width: 4rem !important; /* 固定宽度，确保内容不被切 */
        
        /* 垂直居中，原始位置 */
        top: 50% !important; 
        transform: translateY(-60%) !important; 
        
        /* 移除所有盒子属性和复杂 z-index */
        background: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important; /* 左对齐 */
        text-align: left !important;
        
        z-index: 40 !important; /* 较低的 z-index */
        pointer-events: none;
    }

    /* 日期大数字：回归原始的堆叠样式和颜色 */
    .hud-day { 
        font-size: 2.5rem !important; /* 适中大小 */
        line-height: 0.9 !important; 
        font-weight: 900 !important;
        margin-bottom: 2px !important;
        
        color: var(--text) !important; /* 使用主题的正常文字颜色 */
        opacity: 1 !important;
        
        /* 回归 subtle glow，而不是强光描边 */
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 5px var(--glow-color) !important;
        letter-spacing: normal !important;
    }
    
    /* 时间和小字 */
    .hud-time-wrapper, .hud-meta { 
        text-shadow: none !important; 
        opacity: 1 !important; 
        color: var(--text-sec) !important; /* 使用次要文字颜色 */
        justify-content: flex-start !important; 
        padding-top: 0 !important;
        border-top: none !important;
        margin-top: 2px !important;
    }
    .hud-time { font-size: 1rem !important; font-weight: 800 !important; color: var(--hud-time-color) !important; }
    .hud-meta { font-size: 0.6rem !important; font-weight: 600 !important; letter-spacing: 0.5px !important; }

    /* --- 2. 卡片变薄 (保持不变) --- */
    .entry-item { padding-block: 10px !important; }
    .entry-card h3 { font-size: 1.2rem !important; font-weight: 900 !important; margin-bottom: 2px !important; line-height: 1.2 !important; }
    .entry-card p {
        -webkit-line-clamp: 1 !important; line-clamp: 1 !important;
        max-height: 1.2em !important; font-size: 0.8rem !important; margin-bottom: 0 !important;
    }
    .entry-item.active-focus .entry-card { z-index: 50 !important; }

   #filter-fab-group {
        position: fixed !important;
        top: auto !important; right: auto !important;
        
        /* 【核心修复】固定在左边缘 0.5rem 处 */
        left: 0.5rem !important; 
        
        bottom: calc(2rem + env(safe-area-inset-bottom)) !important;
        
        transform: none !important; /* 移除任何平移 */
        
        display: flex !important; flex-direction: column-reverse !important; 
        align-items: flex-start !important; /* 【关键】左对齐 */
        gap: 16px !important;
        z-index: 80 !important;
    }
    
    /* 轨道和卡片位置保持不变 */
    .timeline-rail-container { left: var(--rail-x) !important; transform: translateX(-50%) !important; }
    .entry-card-wrapper { padding-left: calc(var(--rail-x) + 1.2rem) !important; padding-right: 1rem !important; }
    
    /* 编辑器 */
    #editor-panel { top: 0 !important; height: 100dvh !important; border-radius: 0 !important; }
    #editor-panel .p-6 { padding: 16px !important; }
}


#btn-ai-summary {
    z-index: 30 !important; /* 降低到 30，低于主要的写日记按钮和气泡 (99999) */
}
#tutorial-bubble {
    z-index: 99999 !important; /* 确保它高于所有 FABs (z-index 60-40) */
}
