:root {
    --bg: #f7e9e9;
    --bg-light: #fef5f5;
    --shadow-dark: #ddcfcf;
    --shadow-light: #ffffff;
    --accent: #d69e9e;
    --accent-soft: #e2b6b6;
    --text-primary: #6d4c4c;
    --text-secondary: #9e7a7a;
    --completed: #b5c9a0;
    --locked: #cbb2b2;
    --today-glow: #f3c1c1;
    --gray-disabled: #d5c5c5;
    --bubble-mine: #e8e0f0;
    --bubble-hers: #fce4e4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

.handwritten {
    font-family: 'Ma Shan Zheng', cursive;
}

.hidden {
    display: none !important;
}

.neu-raised {
    background: var(--bg);
    border-radius: 24px;
    box-shadow: 
        8px 8px 20px var(--shadow-dark),
        -8px -8px 20px var(--shadow-light);
}

.neu-pressed {
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 
        inset 4px 4px 8px var(--shadow-dark),
        inset -4px -4px 8px var(--shadow-light);
}

.neu-flat {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    border-radius: 20px;
    box-shadow: 
        6px 6px 12px var(--shadow-dark),
        -6px -6px 12px var(--shadow-light);
}

.timer-container {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        box-shadow: 
            8px 8px 20px var(--shadow-dark),
            -8px -8px 20px var(--shadow-light);
    }
    50% {
        box-shadow: 
            8px 8px 20px var(--shadow-dark),
            -8px -8px 20px var(--shadow-light),
            0 0 40px rgba(214, 158, 158, 0.25);
    }
}

.timer-numbers {
    font-family: 'Ma Shan Zheng', cursive;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem 1rem;
}

.time-group {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.digit-flip {
    display: inline-block;
    transition: transform 0.1s ease, color 0.1s ease;
}

.digit-flip.changed {
    transform: scale(1.08);
    color: var(--accent);
}

.moment-card {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    border-radius: 24px;
    box-shadow: 
        8px 8px 20px var(--shadow-dark),
        -8px -8px 20px var(--shadow-light);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.moment-card.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

.moment-card.fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.date-tag {
    background: linear-gradient(145deg, var(--accent-soft), var(--accent));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    box-shadow: 
        3px 3px 6px var(--shadow-dark),
        -1px -1px 4px rgba(255,255,255,0.5);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.date-tag.today {
    background: linear-gradient(145deg, #f0b6b6, #d69e9e);
    box-shadow: 0 0 15px var(--today-glow), 3px 3px 8px var(--shadow-dark);
    animation: softPulse 2s infinite;
}

.date-tag.today::after {
    content: "❤️";
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.9;
}

@keyframes softPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

#momentText {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

#momentText::-webkit-scrollbar {
    width: 5px;
    background: transparent;
}

#momentText::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
    transition: background 0.2s ease;
}

#momentText::-webkit-scrollbar-track {
    background: transparent;
}

#momentText:hover {
    scrollbar-color: var(--accent-soft) var(--bg);
}

#momentText:hover::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
}

#momentText:hover::-webkit-scrollbar-track {
    background: var(--bg);
}

.scroll-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

#momentText.has-overflow ~ .scroll-gradient {
    opacity: 1;
}

#momentText.has-overflow.scrolled-to-bottom ~ .scroll-gradient {
    opacity: 0;
}

@media (max-width: 480px) {
    #momentText {
        max-height: 150px;
    }
    .scroll-gradient {
        height: 30px;
    }
}

.compact-date-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem 0;
}

.date-nav-btn {
    background: var(--bg);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.date-nav-btn:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.current-date-btn {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 40px;
    box-shadow: 
        5px 5px 10px var(--shadow-dark),
        -5px -5px 10px var(--shadow-light);
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

.current-date-btn:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.calendar-popup {
    position: absolute;
    z-index: 100;
    background: var(--bg);
    border-radius: 32px;
    box-shadow: 
        12px 12px 28px var(--shadow-dark),
        -12px -12px 28px var(--shadow-light);
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 340px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    display: none;
}

.calendar-popup.show {
    display: block;
}

.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.month-nav button {
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    font-size: 1.2rem;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.month-nav button:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.month-year {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}

.day-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 0.9rem;
    font-family: 'Ma Shan Zheng', cursive;
    background: var(--bg);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.1s;
    border: none;
    width: 100%;
    padding: 0;
}

.day-cell:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.day-cell.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
    color: transparent;
    pointer-events: none;
}

.day-cell.disabled {
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    background: var(--bg);
    color: var(--gray-disabled);
    cursor: not-allowed;
    opacity: 0.5;
}

.day-cell.today {
    background: linear-gradient(145deg, #f0b6b6, #d69e9e);
    color: white;
    box-shadow: 0 0 10px var(--today-glow), 3px 3px 6px var(--shadow-dark);
}

.day-cell.selected {
    background: var(--accent);
    color: white;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.milestone-track {
    background: var(--bg);
    border-radius: 10px;
    box-shadow: 
        inset 3px 3px 6px var(--shadow-dark),
        inset -3px -3px 6px var(--shadow-light);
}

.milestone-fill {
    background: linear-gradient(90deg, var(--completed), #b5d0b0);
    border-radius: 8px;
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.05),
        inset 0 1px 2px rgba(255,255,255,0.3);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
    60% { transform: scale(1); }
}

.counter-badge {
    background: var(--bg);
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: var(--accent);
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    font-family: 'Ma Shan Zheng', cursive;
}

.milestone-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all 0.2s ease;
}

.milestone-mark.completed {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    color: var(--completed);
}

.milestone-mark.locked {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    background: var(--bg);
    opacity: 0.9;
}

.milestone-mark svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
    border-radius: 1px;
}

.password-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(247, 233, 233, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.password-card {
    width: 100%;
    max-width: 360px;
    padding: 2.5rem 2rem;
    background: var(--bg);
    border-radius: 40px;
    box-shadow: 12px 12px 28px var(--shadow-dark), -12px -12px 28px var(--shadow-light);
    text-align: center;
}

.password-card h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.password-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: var(--bg);
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 2rem;
    text-align: center;
    transition: all 0.2s ease;
}

.password-input.error {
    box-shadow: inset 6px 6px 12px rgba(214, 158, 158, 0.4), inset -6px -6px 12px rgba(255, 255, 255, 0.7);
    color: #b29696;
}

.password-input.error::placeholder {
    color: #b29696;
    opacity: 0.9;
}

.password-input.locked {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    color: #a58e8e;
    opacity: 0.8;
    cursor: not-allowed;
}

.password-input.locked::placeholder {
    color: #a58e8e;
    opacity: 0.9;
}

.password-input.success {
    box-shadow: inset 6px 6px 12px rgba(165, 200, 140, 0.3), inset -6px -6px 12px #ffffff;
}

.password-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(145deg, var(--bg-light), #ecdcdc);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.1s;
    font-family: 'Ma Shan Zheng', cursive;
}

.password-btn span {
    position: relative;
    display: inline-block;
    color: var(--accent);
    z-index: 1;
}

.password-btn span::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: transparent;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine-text 2s infinite linear;
    pointer-events: none;
    z-index: 2;
}

@keyframes shine-text {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.password-btn:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.password-btn:disabled {
    opacity: 0.6;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    cursor: not-allowed;
}

.password-btn:disabled span::after {
    animation: none;
}

.hint {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.floating-heart {
    position: absolute;
    opacity: 0.15;
    animation: floatUp 15s linear infinite;
    pointer-events: none;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* 消息气泡样式 - 使用直接颜色值确保显示正确 */
.chat-bubble-mine {
    background: #e8e0f0;  /* 雨的气泡颜色 */
    border-radius: 24px 24px 4px 24px;
    padding: 0.75rem 1.25rem;
    max-width: 85%;
    box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
    align-self: flex-end;
    margin-left: auto;
}

.chat-bubble-hers {
    background: #fce4e4;  /* 颖的气泡颜色 */
    border-radius: 24px 24px 24px 4px;
    padding: 0.75rem 1.25rem;
    max-width: 85%;
    box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
    align-self: flex-start;
    margin-right: auto;
}

.chat-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-align: right;
}

/* 确保消息内容中的换行符正确显示 */
.chat-bubble-mine p,
.chat-bubble-hers p {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px 4px 12px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) var(--bg);
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

.message-list::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 10px;
}

.message-input-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.sender-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-input {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 40px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    min-height: 48px;
}

.message-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.send-btn {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.send-btn:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.history-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(247, 233, 233, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
}

.history-modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    background: var(--bg);
    border-radius: 32px;
    box-shadow: 12px 12px 28px var(--shadow-dark), -12px -12px 28px var(--shadow-light);
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--shadow-dark);
}

.history-modal-header h3 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.close-modal-btn {
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.close-modal-btn:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.modal-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 0.5rem 0 1.2rem 0;
}

.modal-date-nav-btn {
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.modal-date-nav-btn:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.modal-current-date {
    background: linear-gradient(145deg, var(--bg-light), var(--bg));
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.modal-current-date:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

#modalCalendarPopup {
    margin-bottom: 1rem;
    width: 100%;
    max-width: none;
    left: 0;
    transform: none;
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    padding: 1rem;
}

.history-message-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 12px 4px 12px 0;
    max-height: 50vh;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) var(--bg);
}

.history-message-list::-webkit-scrollbar {
    width: 6px;
}

.history-message-list::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

.history-message-list::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 10px;
}

.history-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px dashed var(--accent-soft);
}

.history-link:hover {
    color: var(--text-primary);
}

/* ========== 新增评论区域样式 ========== */
#scrollHint {
    text-align: center; 
    font-size: 0.7rem; 
    color: var(--accent); 
    margin-bottom: 0.2rem;
    background: var(--bg-light); 
    border-radius: 30px; 
    padding: 0.2rem 1rem; 
    display: inline-block;
}
#commentsSection {
    margin-top: 1.2rem;
    border-top: 1px solid var(--shadow-dark);
    padding-top: 1rem;
    transition: opacity 0.3s, filter 0.3s;
}
#commentsSection.blur-comments {
    opacity: 0.5;
    filter: blur(2px);
    pointer-events: none;
    transition: 0.2s;
}
.comment-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(214,158,158,0.4) transparent;
}
.comment-list::-webkit-scrollbar { width: 6px; background: transparent; }
.comment-list::-webkit-scrollbar-thumb { background: rgba(214,158,158,0.4); border-radius: 20px; }
.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; color: var(--accent); flex-shrink: 0;
}
.comment-bubble {
    background: #fce4e4;  /* 颖的气泡色 */
    border-radius: 18px 18px 18px 4px;
    padding: 0.6rem 1rem;
    max-width: calc(100% - 42px);
    box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}
.comment-bubble p {
    font-size: 0.9rem; line-height: 1.4;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}
.comment-meta {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.65rem; color: var(--text-secondary);
    flex-wrap: wrap;
}
.delete-comment, .delete-reply, .reply-btn-sm {
    color: #c47a7a; cursor: pointer; font-size: 0.7rem;
    padding: 2px 6px; border-radius: 12px;
    background: var(--bg); box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
    transition: 0.1s;
    display: inline-block;
}
.reply-btn-sm {
    color: var(--accent);
}
.delete-comment:active, .delete-reply:active, .reply-btn-sm:active {
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}
.replies-container {
    margin-top: 0.5rem;
    margin-left: 0px;
    padding-left: 1.2rem;
    border-left: 2px dashed #e2c5c5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.reply-entry {
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    word-break: break-word;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.2rem 0 0.2rem 0.3rem;
}
.reply-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.4rem;
}
.reply-sender {
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
}
.reply-to {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}
.reply-content {
    color: var(--text-primary);
    word-break: break-word;
    flex: 1 1 100%;
    margin-top: 0.1rem;
}
.reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.reply-time {
    color: var(--text-secondary);
}
.reply-actions {
    display: flex;
    gap: 0.3rem;
}
.comment-input-wrapper {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--bg); border-radius: 40px;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    margin-top: 0.5rem;
}
.comment-input {
    flex: 1; background: transparent; border: none; font-size: 0.9rem;
    color: var(--text-primary); outline: none;
}
.comment-input::placeholder { color: var(--text-secondary); opacity: 0.7; }
.comment-send {
    background: var(--accent); border: none; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    cursor: pointer;
}
.comment-send:active { box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light); }
.comment-send svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

#replyContext {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    margin: 0.2rem 0 0.2rem 0.5rem;
    color: var(--accent);
}
.reply-context-badge {
    background: #e2b6b6;
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    box-shadow: 2px 2px 5px var(--shadow-dark);
}
.cancel-reply {
    background: var(--bg);
    border: none;
    color: #c47a7a;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 12px;
    border-radius: 30px;
    box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
    font-weight: 500;
}
.cancel-reply:active {
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

/* ========== 表情弹窗样式 ========== */
.emoji-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.emoji-btn:hover {
    background: var(--shadow-dark);
}
.emoji-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.emoji-picker {
    position: fixed;
    z-index: 3500;
    background: var(--bg-light);
    border: 2px solid var(--shadow-light);
    border-radius: 24px;
    box-shadow: 12px 12px 28px var(--shadow-dark), -12px -12px 28px var(--shadow-light);
    width: 300px;
    max-width: 90vw;
    height: 320px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: opacity 0.1s;
    opacity: 1;
    pointer-events: auto;
}
.emoji-picker.hidden {
    display: none !important;
}
.emoji-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--shadow-dark);
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}
.emoji-cat {
    background: var(--bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s;
    color: var(--text-primary);
    flex-shrink: 0;
}
.emoji-cat.active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    background: var(--accent-soft);
    color: white;
}
.emoji-cat:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.25rem 0 0.25rem;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) var(--bg);
}
.emoji-grid::-webkit-scrollbar {
    width: 6px;
}
.emoji-grid::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 8px;
}
.emoji-grid::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 8px;
}
.emoji-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
.emoji-item {
    background: var(--bg);
    border: none;
    border-radius: 12px;
    box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
    font-size: 1.8rem;
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.1s;
    padding: 0;
    color: var(--text-primary);
}
.emoji-item:active {
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}
.emoji-item img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

@media (max-width: 480px) {
    body {
        padding: 0 0.5rem;
    }
    .w-full.max-w-2xl {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    header.text-center,
    .flex.items-center.justify-center,
    .mt-3.text-center,
    .text-xs.mt-4.pt-4.text-center {
        text-align: center !important;
    }
    .timer-numbers {
        font-size: 1.8rem !important;
        gap: 0.25rem 0.5rem;
        justify-content: center;
    }
    .time-group {
        font-size: 1.6rem;
    }
    .timer-numbers .digit-flip {
        min-width: 1.8rem;
        text-align: center;
    }
    #milliseconds {
        font-size: 2rem !important;
    }
    .flex.items-center.gap-2.mb-4 {
        flex-wrap: nowrap !important;
        gap: 0.25rem;
    }
    .flex.items-center.gap-2.mb-4 svg {
        width: 1.2rem !important;
        height: 1.2rem !important;
        flex-shrink: 0;
    }
    .flex.items-center.gap-2.mb-4 h2 {
        font-size: 0.9rem !important;
        white-space: nowrap;
    }
    .message-input-container {
        flex-wrap: nowrap !important;
        gap: 0.3rem;
    }
    .sender-icon, .send-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    .sender-icon {
        font-size: 1rem;
    }
    .message-input {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-height: 40px;
        min-width: 150px;
    }
    .send-btn svg {
        width: 18px;
        height: 18px;
    }
    .flex.items-center.justify-between.mb-2 h2 {
        font-size: 0.85rem !important;
    }
    .flex.items-center.justify-between.mb-2 {
        justify-content: space-between !important;
    }
    .counter-badge {
        margin-left: auto;
        font-size: 0.8rem;
        padding: 2px 10px;
    }
    .moment-card .flex.items-start.gap-4 svg.w-5.h-5 {
        width: 1.2rem !important;
        height: 1.2rem !important;
    }
    .moment-card .handwritten.text-xl {
        font-size: 1.2rem !important;
    }
    .moment-card .date-tag {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    #milestones .flex.items-center.gap-3.py-1 {
        gap: 0.5rem !important;
    }
    .milestone-mark {
        width: 28px !important;
        height: 28px !important;
    }
    .milestone-mark svg {
        width: 16px !important;
        height: 16px !important;
    }
    #milestones .flex.items-center.gap-3.py-1 span.text-sm {
        font-size: 0.8rem !important;
    }
    #milestones .flex.items-center.gap-3.py-1 span.text-xs {
        font-size: 0.7rem !important;
        white-space: nowrap;
    }
    .compact-date-selector {
        gap: 0.5rem;
    }
    .current-date-btn {
        font-size: 1rem;
        min-width: 120px;
        padding: 0.6rem 0.5rem;
    }
    .date-nav-btn {
        width: 40px;
        height: 40px;
    }
    .calendar-popup {
        width: 95vw;
        padding: 1rem;
    }
    .day-cell {
        font-size: 0.85rem;
    }
    .neu-raised,
    .neu-flat {
        padding: 1rem !important;
    }
    .message-list {
        max-height: 200px;
    }
    .history-modal-content {
        padding: 1.2rem 1rem;
    }
    .history-message-list {
        max-height: 40vh;
    }
    .chat-bubble-mine p,
    .chat-bubble-hers p {
        font-size: 1rem !important;
    }
    .password-card {
        padding: 2rem 1.5rem;
    }
    .password-card h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 375px) {
    .timer-numbers {
        font-size: 1.5rem !important;
    }
    .time-group {
        font-size: 1.4rem;
    }
    .timer-numbers .digit-flip {
        min-width: 1.5rem;
    }
    #milliseconds {
        font-size: 1.8rem !important;
    }
    .moment-card .handwritten.text-xl {
        font-size: 1.1rem !important;
    }
    .message-input {
        min-width: 120px;
    }
    .message-list {
        max-height: 180px;
    }
}

@media (max-width: 320px) {
    .timer-numbers {
        font-size: 1.3rem !important;
    }
    .time-group {
        font-size: 1.2rem;
    }
    .current-date-btn {
        min-width: 100px;
        font-size: 0.9rem;
    }
    .password-card {
        padding: 1.5rem 1rem;
    }
}