/* ========== Memo — 记事板块（Warm Stone 风格一致） ========== */

/* ---- 日记/记事 tab 切换 ---- */
.journal-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #EBE5DD;
}
.journal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid #E4DDD3;
    background: #FBF8F3;
    color: #6E645A;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: var(--track-wide);
    cursor: pointer;
    transition: all 200ms ease;
}
.journal-tab:hover {
    border-color: #C2855B;
    color: #A66E47;
}
.journal-tab.active {
    background: #C2855B;
    border-color: #C2855B;
    color: #FFF;
    box-shadow: 0 2px 8px rgba(194,133,91,0.25);
}

/* ---- 面板布局 ---- */
.memo-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.memo-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 4px 24px;
}

/* ---- 工具栏 ---- */
.memo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #EBE5DD;
}
.memo-toolbar-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.memo-toolbar-name {
    font-family: var(--font-sans);
    font-size: var(--text-xl);
    font-weight: 600;
    color: #2D2926;
    letter-spacing: var(--track-tight);
}
.memo-toolbar-count {
    font-size: 13px;
    color: #8F8478;
}
.memo-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    background: #C2855B;
    color: #FFF;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 2px 6px rgba(194,133,91,0.2);
}
.memo-add-btn:hover {
    background: #A66E47;
    transform: translateY(-1px);
}
.memo-add-btn:active { transform: scale(0.96); }

/* ---- 文档卡片网格 ---- */
.memo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.memo-card {
    background: #FFFCF8;
    border: 1px solid #EFE9E0;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all 220ms ease;
}
.memo-card:hover {
    border-color: #D8C9B6;
    box-shadow: 0 6px 20px rgba(80,60,40,0.07);
    transform: translateY(-2px);
}
.memo-card:hover .memo-card-title {
    color: #A66E47;
}
.memo-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.memo-card-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: #2D2926;
    letter-spacing: var(--track-tight);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}
.memo-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 40%;
}
.memo-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.memo-card-snippet {
    font-size: 13px;
    line-height: 1.6;
    color: #6E645A;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}
.memo-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed #EFE9E0;
}
.memo-card-time {
    font-size: 12px;
    color: #8F8478;
}
.memo-card-actions {
    display: flex;
    gap: 4px;
}
.memo-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #8A7E71;
    font-size: 12px;
    cursor: pointer;
    transition: all 180ms ease;
}
.memo-act-btn:hover {
    background: rgba(194,133,91,0.1);
    color: #A66E47;
}
.memo-act-btn.memo-act-del:hover {
    background: rgba(196,114,110,0.1);
    color: #C4726E;
}

/* ---- 空状态 / 骨架 ---- */
.memo-empty {
    text-align: center;
    padding: 70px 20px;
}
.memo-empty-icon {
    color: #B0A599;
    margin-bottom: 16px;
}
.memo-empty-title {
    font-size: 17px;
    font-weight: 600;
    color: #4A4440;
    margin-bottom: 8px;
}
.memo-empty-sub {
    font-size: 13px;
    color: #8F8478;
    margin-bottom: 22px;
}
.memo-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.memo-skeleton-card {
    height: 150px;
    border-radius: 16px;
    background: linear-gradient(100deg, #F6F1E9 40%, #FCF9F4 50%, #F6F1E9 60%);
    background-size: 200% 100%;
    animation: memoShimmer 1.4s infinite;
}
@keyframes memoShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---- 编辑弹窗 ---- */
.memo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,41,38,0.42);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.memo-dialog {
    width: 620px;
    max-width: 94vw;
    max-height: 88vh;
    background: #FFFCF8;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(45,41,38,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: memoPop 200ms ease;
}
@keyframes memoPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.memo-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #EFE9E0;
    font-size: 15px;
    font-weight: 600;
    color: #2D2926;
}
.memo-dialog-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #8F8478;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 150ms ease;
}
.memo-dialog-close:hover { background: #F3EDE4; color: #2D2926; }
.memo-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.memo-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.memo-field-grow { flex: 1; min-height: 200px; }
.memo-field label {
    font-size: 12px;
    font-weight: 500;
    color: #6E645A;
    letter-spacing: var(--track-wide);
}
.memo-title-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #E4DDD3;
    border-radius: 10px;
    background: #FFF;
    font-family: var(--font-sans);
    font-size: 14px;
    color: #2D2926;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.memo-title-input:focus {
    border-color: #C2855B;
    box-shadow: 0 0 0 3px rgba(194,133,91,0.12);
}
.memo-content-input {
    width: 100%;
    flex: 1;
    min-height: 220px;
    padding: 14px 16px;
    border: 1px solid #E4DDD3;
    border-radius: 10px;
    background: #FFF;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: #2D2926;
    resize: vertical;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.memo-content-input:focus {
    border-color: #C2855B;
    box-shadow: 0 0 0 3px rgba(194,133,91,0.12);
}
.memo-content-input::placeholder { color: #A89C90; }
.memo-title-input::placeholder { color: #A89C90; }

/* ---- 标签编辑区 ---- */
.memo-tag-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.memo-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 28px;
    padding: 10px 12px;
    background: #FBF8F3;
    border: 1px dashed #E4DDD3;
    border-radius: 10px;
    align-items: center;
}
.memo-tag-placeholder {
    font-size: 12px;
    color: #A89C90;
}
.memo-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255,255,255,0.7);
}
.memo-tag-chip-x {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.65;
    transition: opacity 150ms ease;
}
.memo-tag-chip-x:hover { opacity: 1; }
.memo-tag-add-row {
    display: flex;
    gap: 8px;
}
.memo-tag-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E4DDD3;
    border-radius: 8px;
    background: #FFF;
    font-size: 13px;
    color: #2D2926;
    outline: none;
    transition: border-color 180ms ease;
}
.memo-tag-input:focus { border-color: #C2855B; }
.memo-tag-add-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #EFE8DE;
    color: #6B6258;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 180ms ease;
}
.memo-tag-add-btn:hover { background: #E3DACD; color: #4A4440; }
.memo-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.memo-quick-tag {
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid;
    border-color: var(--qt-color);
    color: var(--qt-color);
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    transition: all 160ms ease;
}
.memo-quick-tag:hover {
    background: var(--qt-color);
    color: #FFF;
    transform: translateY(-1px);
}

/* ---- 弹窗底部 ---- */
.memo-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #EFE9E0;
    background: #FDFAF6;
}
.memo-dialog-footer .btn-cancel,
.memo-dialog-footer .btn-confirm {
    padding: 9px 24px;
    border-radius: 10px;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
}
.memo-dialog-footer .btn-cancel {
    background: #EFE8DE;
    color: #6B6258;
}
.memo-dialog-footer .btn-cancel:hover { background: #E3DACD; }
.memo-dialog-footer .btn-confirm {
    background: #C2855B;
    color: #FFF;
    box-shadow: 0 2px 6px rgba(194,133,91,0.2);
}
.memo-dialog-footer .btn-confirm:hover { background: #A66E47; }
.memo-dialog-footer .btn-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- 查看弹窗（只读） ---- */
.memo-view-dialog { width: 680px; }
.memo-view-body { gap: 14px; }
.memo-view-loading,
.memo-view-empty {
    padding: 46px 20px;
    text-align: center;
    color: #8F8478;
    font-size: 13px;
}
.memo-view-title {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 600;
    color: #2D2926;
    letter-spacing: var(--track-tight);
    line-height: 1.45;
    word-break: break-word;
}
.memo-view-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #8F8478;
}
.memo-view-meta-sep { opacity: 0.6; }
.memo-view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.memo-view-notags {
    font-size: 12px;
    color: #A89C90;
}
.memo-view-content {
    flex: 1;
    overflow-y: auto;
    min-height: 180px;
    max-height: 46vh;
    padding: 16px 18px;
    background: #FBF8F3;
    border: 1px solid #EFE9E0;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.85;
    color: #3A3530;
    white-space: pre-wrap;
    word-break: break-word;
}
