/* ==================== 千灯·燃燃 云端记忆库 v1.0 ==================== */
/* 暖黄色温馨色调 · 孔明灯 · 万家灯火 · 温柔质感 */

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFEED6 50%, #FFE4C4 100%);
    color: #333;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(255, 200, 100, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(255, 180, 80, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 190, 90, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== 孔明灯动画容器 ===== */
#floatingHearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* 孔明灯上浮动画 */
@keyframes lanternFloat {
    0% {
        transform: translateY(0) rotate(-2deg) scale(0.6);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    30% {
        opacity: 0.7;
    }
    60% {
        opacity: 0.5;
        transform: translateY(-60vh) rotate(3deg) scale(0.8);
    }
    85% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-105vh) rotate(-1deg) scale(0.9);
        opacity: 0;
    }
}

/* 灯芯闪烁 */
@keyframes flicker {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* 暖光粒子闪烁 */
@keyframes particleTwinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.3); }
}

/* ===== 应用容器 ===== */
.app-container {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 0;
}

/* ===== 左侧面板 ===== */
.left-panel {
    width: 300px;
    min-width: 300px;
    background: rgba(255, 248, 240, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(212, 160, 74, 0.10);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* 品牌 */
.brand {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(212, 160, 74, 0.12);
}

.brand-icon {
    font-size: 40px;
    margin-bottom: 6px;
    animation: gentlePulse 4s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #C4943A;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 13px;
    color: #B8860B;
    margin-top: 4px;
}

/* 天数 */
.days-counter {
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, rgba(212, 160, 74, 0.08), rgba(196, 148, 58, 0.04));
    border-radius: 16px;
    border: 1px solid rgba(212, 160, 74, 0.08);
}

.days-label {
    font-size: 13px;
    color: #8888aa;
}

.days-number {
    font-size: 38px;
    font-weight: 800;
    color: #C4943A;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(196, 148, 58, 0.15);
}

/* 分类标签栏 */
.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 248, 240, 0.8);
    border: 1px solid rgba(212, 160, 74, 0.10);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.category-tag:hover {
    background: rgba(212, 160, 74, 0.08);
    border-color: rgba(212, 160, 74, 0.2);
    transform: translateY(-1px);
}

.category-tag.active {
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(212, 160, 74, 0.2);
}

/* 统计 */
.stats-section {
    background: rgba(255, 248, 240, 0.6);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(212, 160, 74, 0.06);
}

.stats-header {
    font-size: 13px;
    font-weight: 600;
    color: #C4943A;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item {
    text-align: center;
    padding: 8px 4px;
    background: rgba(255, 248, 240, 0.4);
    border-radius: 10px;
}

.stat-label {
    font-size: 11px;
    color: #9999bb;
}

.stat-number {
    font-size: 18px;
    font-weight: 700;
    color: #C4943A;
}

/* 日历 */
.calendar-section {
    background: rgba(255, 248, 240, 0.6);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(212, 160, 74, 0.06);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #C4943A;
}

.cal-nav {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #D4A04A;
    padding: 2px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.cal-nav:hover {
    background: rgba(212, 160, 74, 0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    color: #c4c4d0;
    padding: 4px 0;
    font-weight: 500;
}

.calendar-day {
    text-align: center;
    padding: 6px 2px;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
    position: relative;
}

.calendar-day:hover {
    background: rgba(212, 160, 74, 0.08);
}

.calendar-day.today {
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(212, 160, 74, 0.25);
}

.calendar-day.has-memory::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #D4A04A;
}

.calendar-day.has-high-rating::after {
    width: 6px;
    height: 6px;
    background: #ff9800;
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.4);
}

/* 底部按钮 */
.bottom-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: auto;
    padding-top: 12px;
}

.action-btn {
    background: rgba(255, 248, 240, 0.8);
    border: 1px solid rgba(212, 160, 74, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
    color: #C4943A;
}

.action-btn:hover {
    background: rgba(212, 160, 74, 0.08);
    transform: scale(1.05);
}

/* ===== 右侧面板 ===== */
.right-panel {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

/* 选项卡 */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.tab {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    color: #666;
    background: rgba(255, 248, 240, 0.6);
}

.tab:hover {
    background: rgba(212, 160, 74, 0.06);
}

.tab.active {
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(212, 160, 74, 0.15);
    font-weight: 500;
}

.search-input {
    padding: 7px 14px;
    border: 1px solid rgba(212, 160, 74, 0.10);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 248, 240, 0.6);
    width: 180px;
    transition: all 0.2s;
    color: #555;
}

.search-input:focus {
    border-color: #D4A04A;
    box-shadow: 0 0 0 3px rgba(212, 160, 74, 0.06);
}

.search-input::placeholder {
    color: #c4c4d0;
}

/* 记忆列表区 */
.memories-section {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.memories-section::-webkit-scrollbar {
    width: 4px;
}

.memories-section::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 74, 0.2);
    border-radius: 4px;
}

.memories-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #c4c4d0;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-text {
    font-size: 14px;
}

/* 记忆卡片 */
.memory-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px 18px;
    border-left: 4px solid #D4A04A;
    box-shadow: 0 2px 12px rgba(212, 160, 74, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

.memory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 160, 74, 0.10);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    opacity: 0.6;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.04);
    opacity: 1;
    transform: scale(1.1);
}

.btn-edit:hover { background: rgba(76, 175, 80, 0.08); }
.btn-delete:hover { background: rgba(229, 57, 53, 0.08); }
.btn-reply:hover { background: rgba(212, 160, 74, 0.08); }

.card-content {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #9999bb;
}

.category-badge, .type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.category-badge {
    background: rgba(212, 160, 74, 0.06);
    color: #C4943A;
}

.type-badge {
    background: rgba(180, 134, 107, 0.06);
    color: #8B7355;
}

.type-badge.private {
    background: rgba(139, 115, 85, 0.06);
    color: #8B7355;
}

/* 星级评分展示 */
.star-rating-display {
    display: inline-flex;
    gap: 1px;
}

.star-filled {
    color: #ff9800;
    font-size: 13px;
}

.star-empty {
    color: #ddd;
    font-size: 13px;
}

/* 留言板 */
.messages-section {
    display: none;
    flex-direction: column;
    height: 100%;
}

.messages-section.show {
    display: flex;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.message-list::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 74, 0.15);
    border-radius: 4px;
}

.message-item {
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    border-left: 3px solid #D4A04A;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.message-item.ai {
    border-left-color: #C4943A;
}

.msg-author {
    font-size: 13px;
    font-weight: 600;
    color: #D4A04A;
    margin-bottom: 4px;
}

.message-item.ai .msg-author {
    color: #C4943A;
}

.msg-time {
    font-size: 11px;
    color: #c4c4d0;
    margin-top: 4px;
}

.reply-content {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(212, 160, 74, 0.04);
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    border-left: 2px solid #d0c4e8;
}

.msg-reply-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #D4A04A;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.msg-reply-btn:hover {
    background: rgba(212, 160, 74, 0.06);
}

.message-input-container {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.message-input-container input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid rgba(212, 160, 74, 0.10);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    background: rgba(255, 248, 240, 0.6);
    transition: all 0.2s;
    color: #555;
}

.message-input-container input:focus {
    border-color: #D4A04A;
    box-shadow: 0 0 0 3px rgba(212, 160, 74, 0.06);
}

.message-input-container button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

.message-input-container button:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 10px rgba(212, 160, 74, 0.25);
}

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #FFEED6;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #C4943A;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #c4c4d0;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #666;
}

.modal-body {
    padding: 16px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px 20px;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #8888aa;
    margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(212, 160, 74, 0.10);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: rgba(255, 248, 240, 0.3);
    color: #444;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #D4A04A;
    box-shadow: 0 0 0 3px rgba(212, 160, 74, 0.06);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 星级 */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-rating .star {
    font-size: 24px;
    cursor: pointer;
    color: #ddd;
    transition: all 0.15s;
}

.star-rating .star.active {
    color: #ff9800;
}

.star-rating .star:hover {
    transform: scale(1.2);
}

/* 按钮 */
.btn {
    padding: 10px 24px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-primary {
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    box-shadow: 0 2px 8px rgba(212, 160, 74, 0.2);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(212, 160, 74, 0.3);
}

.btn-secondary {
    background: rgba(255, 248, 240, 0.8);
    color: #D4A04A;
    border: 1px solid rgba(212, 160, 74, 0.08);
}

.btn-secondary:hover {
    background: rgba(212, 160, 74, 0.06);
}

/* 添加按钮 */
.add-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4A04A, #C4943A);
    color: #fff;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 160, 74, 0.25);
    transition: all 0.2s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.add-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(212, 160, 74, 0.35);
}

/* Toast 动画 */
@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* 日期详情弹窗内容 */
.date-detail-item {
    padding: 10px 14px;
    border-left: 3px solid #D4A04A;
    margin-bottom: 8px;
    background: rgba(255, 248, 240, 0.4);
    border-radius: 0 10px 10px 0;
}

.dd-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

/* 分类管理中的活跃态 */
.category-item.active {
    background: rgba(212, 160, 74, 0.06);
    border-radius: 10px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
        gap: 12px;
        border-right: none;
        border-bottom: 1px solid rgba(212, 160, 74, 0.08);
    }
    
    .right-panel {
        height: auto;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .search-input {
        width: 120px;
    }
    
    .add-button {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 74, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 74, 0.25);
}
