/* Palmer 风格 */
:root {
    --bg-cream: #F5F3EE;
    --bg-white: #FFFFFF;
    --bg-warm: #EBE8E2;
    --text-dark: #1A1A1A;
    --text-medium: #4A4A4A;
    --text-light: #8A8A8A;
    --accent-blue: #2C4A6E;
    --accent-teal: #3D6B6B;
    --border-light: rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 2px 20px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
    --radius: 24px;
    --radius-sm: 12px;
    --radius-pill: 50px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Inter, -apple-system, sans-serif; background: var(--bg-cream); color: var(--text-dark); min-height: 100vh; line-height: 1.6; font-size: 15px; }
.view { min-height: 100vh; }
.hidden { display: none !important; }
.login-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 40px; text-align: center; }
.login-container h1 { font-size: 2.8rem; font-weight: 300; margin-bottom: 0.5rem; text-transform: lowercase; }
.login-container p { color: var(--text-light); margin-bottom: 3rem; }
.btn-primary { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: var(--text-dark); color: var(--bg-cream); border: none; border-radius: var(--radius-pill); font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { background: var(--accent-blue); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: var(--bg-white); color: var(--text-dark); border: 1px solid var(--border-light); border-radius: var(--radius-pill); font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.btn-secondary:hover { background: var(--bg-warm); border-color: var(--text-light); }
.btn-text { background: none; border: none; color: var(--text-light); cursor: pointer; padding: 10px 16px; font-size: 0.9rem; transition: var(--transition); border-radius: var(--radius-pill); }
.btn-text:hover { color: var(--text-dark); background: var(--bg-warm); }
.btn-danger { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: transparent; color: #C45C5C; border: 1px solid #C45C5C; border-radius: var(--radius-pill); font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.btn-danger:hover { background: #C45C5C; color: white; }

.header { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; background: var(--bg-cream); position: sticky; top: 0; z-index: 100; }
.header-left h1 { font-size: 1.4rem; font-weight: 400; text-transform: lowercase; }
.header-center { flex: 1; max-width: 360px; margin: 0 40px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--radius-pill); transition: var(--transition); box-shadow: var(--shadow-soft); }
.search-box:focus-within { border-color: var(--text-light); box-shadow: var(--shadow-hover); }
.search-box svg { color: var(--text-light); flex-shrink: 0; width: 18px; height: 18px; }
.search-box input { flex: 1; background: none; border: none; color: var(--text-dark); font-size: 0.9rem; outline: none; }
.search-box input::placeholder { color: var(--text-light); }
.search-box kbd { padding: 4px 8px; background: var(--bg-warm); border: none; border-radius: 6px; font-size: 0.7rem; color: var(--text-light); }
.header-right { display: flex; align-items: center; gap: 8px; }
#user-info { color: var(--text-medium); font-size: 0.9rem; margin-right: 8px; }
.main-content { padding: 20px 40px 100px; max-width: 1400px; margin: 0 auto; }
.tags-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; padding: 8px 0; }
.tag-btn { padding: 10px 20px; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--radius-pill); color: var(--text-medium); font-size: 0.85rem; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-soft); }
.tag-btn:hover { border-color: var(--text-light); color: var(--text-dark); transform: translateY(-1px); }
.tag-btn.active { background: var(--text-dark); border-color: var(--text-dark); color: var(--bg-cream); }
.notes-masonry { column-count: 2; column-gap: 12px; }
.note-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 16px; padding: 0; cursor: pointer; transition: var(--transition); position: relative; box-shadow: var(--shadow-soft); break-inside: avoid; margin-bottom: 12px; overflow: hidden; }
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: transparent; }
.note-cover { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.note-card-body { padding: 12px; }
.note-title { font-size: 0.95rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.note-content { font-size: 0.8rem; line-height: 1.6; color: var(--text-medium); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.note-content.truncated::after { display: none; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.note-tag { padding: 2px 8px; background: var(--bg-warm); border-radius: var(--radius-pill); font-size: 0.7rem; color: var(--accent-teal); }
.note-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border-light); }
.note-date { font-size: 0.7rem; color: var(--text-light); }
.note-images { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.note-images img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: var(--transition); }
.note-images img:hover { transform: scale(1.05); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 100px 20px; color: var(--text-light); }
.empty-state svg { opacity: 0.3; }
.empty-state p { margin-top: 20px; font-size: 1rem; }
.fab { position: fixed; bottom: 40px; right: 40px; width: 56px; height: 56px; background: var(--text-dark); border: none; border-radius: 50%; color: var(--bg-cream); cursor: pointer; box-shadow: var(--shadow-hover); transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.fab:hover { background: var(--accent-blue); transform: scale(1.1) rotate(90deg); }
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26, 26, 26, 0.4); backdrop-filter: blur(8px); }
.modal-content { position: relative; background: var(--bg-white); border: none; border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--border-light); }
.modal-header h2 { font-size: 1.2rem; font-weight: 500; }
.modal-close { background: var(--bg-warm); border: none; color: var(--text-medium); font-size: 1.2rem; cursor: pointer; padding: 0; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--text-dark); color: var(--bg-cream); }
.modal-body { padding: 28px; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; border-top: 1px solid var(--border-light); background: var(--bg-cream); border-radius: 0 0 var(--radius) var(--radius); }
.modal-actions { display: flex; gap: 12px; }
.read-modal-content { max-width: 100%; max-height: 100%; height: 100vh; border-radius: 0; display: flex; flex-direction: column; }
.read-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-light); background: var(--bg-white); flex-shrink: 0; }
.read-back-btn { background: none; border: none; padding: 8px; cursor: pointer; color: var(--text-dark); display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); }
.read-back-btn:hover { background: var(--bg-warm); }
.read-actions { display: flex; gap: 8px; }
.read-action-btn { background: none; border: none; padding: 8px; cursor: pointer; color: var(--text-medium); display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); }
.read-action-btn:hover { background: var(--bg-warm); color: var(--text-dark); }
.read-modal-body { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg-cream); }
.read-title { font-size: 1.5rem; font-weight: 600; color: var(--text-dark); margin-bottom: 16px; line-height: 1.4; }
.read-content { font-size: 1rem; line-height: 1.8; color: var(--text-dark); white-space: pre-wrap; word-break: break-word; }
.read-images { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.read-images img { width: 100%; border-radius: 12px; cursor: pointer; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; font-weight: 500; color: var(--text-medium); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group textarea { width: 100%; padding: 14px 18px; background: var(--bg-cream); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text-dark); font-size: 0.95rem; font-family: inherit; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--text-dark); background: var(--bg-white); }
.form-group textarea { resize: vertical; min-height: 140px; line-height: 1.7; }
.image-upload-area { display: flex; align-items: center; gap: 16px; }
.upload-hint { font-size: 0.8rem; color: var(--text-light); }
.image-preview { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.image-preview-item { position: relative; width: 90px; height: 90px; }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.image-preview-item .remove-image { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; background: var(--text-dark); border: 2px solid var(--bg-white); border-radius: 50%; color: white; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.image-preview-item .remove-image:hover { background: #C45C5C; transform: scale(1.1); }
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); padding: 14px 28px; background: var(--text-dark); border: none; border-radius: var(--radius-pill); color: var(--bg-cream); font-size: 0.9rem; box-shadow: var(--shadow-hover); z-index: 2000; animation: toast-in 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.toast.success { background: var(--accent-teal); }
.toast.error { background: #C45C5C; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@media (max-width: 768px) {
    .header { flex-wrap: wrap; gap: 16px; padding: 16px 20px; }
    .header-center { order: 3; max-width: 100%; margin: 0; width: 100%; }
    .search-box kbd { display: none; }
    .main-content { padding: 16px 16px 100px; }
    .notes-masonry { column-count: 2; column-gap: 10px; }
    .note-card { margin-bottom: 10px; }
    .fab { bottom: 24px; right: 24px; width: 54px; height: 54px; }
    .modal-content { max-height: 85vh; border-radius: var(--radius-sm); }
    .read-modal-content { border-radius: 0; height: 100vh; max-height: 100vh; }
    .modal-header, .modal-body, .modal-footer { padding: 20px; }
}
@media (min-width: 769px) {
    .notes-masonry { column-count: 3; }
    .read-modal-content { max-width: 600px; height: auto; max-height: 90vh; border-radius: var(--radius); }
}
@media (min-width: 1200px) { .notes-masonry { column-count: 4; } }
.image-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(26, 26, 26, 0.95); display: flex; align-items: center; justify-content: center; cursor: zoom-out; backdrop-filter: blur(10px); }
.image-viewer img { max-width: 90%; max-height: 90%; object-fit: contain; border-radius: var(--radius-sm); }
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border-light); border-top-color: var(--text-dark); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
::selection { background: var(--accent-teal); color: white; }
