* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header h1 a { color: #fff; text-decoration: none; }

/* 全局导航栏链接 */
header .main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

header .main-nav a {
    color: #cfd8e3;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}

header .main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

main {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section { margin-bottom: 2rem; }

h2 { margin-bottom: 0.75rem; color: #2c3e50; }

.note-form form { display: flex; flex-direction: column; gap: 0.5rem; }

.note-form input,
.note-form textarea,
.note-form button {
    font: inherit;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
}

.note-form button {
    background: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    width: max-content;
    padding: 0.5rem 1.5rem;
}

.note-form button:hover { background: #34495e; }

.note-list ul { list-style: none; }

.note-list li {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.75rem;
}

.note-list time { font-size: 0.85rem; color: #888; margin-left: 0.5rem; }

.note-list p { margin-top: 0.25rem; color: #555; }

.empty { color: #999; font-style: italic; }
 
.note-head { display: flex; align-items: baseline; gap: 0.5rem; }

.note-head .note-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.note-head .note-actions form { display: inline; }

.note-head .edit-btn {
    color: #2c3e50;
    text-decoration: none;
    border: 1px solid #2c3e50;
    border-radius: 6px;
    padding: 0.2rem 0.7rem;
    font-size: 0.85rem;
}

.note-head .edit-btn:hover { background: #2c3e50; color: #fff; }

.note-head .delete-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.75rem;
    font: inherit;
    cursor: pointer;
}

.note-head .delete-btn:hover { background: #c0392b; }

.note-form .form-actions { display: flex; align-items: center; gap: 1rem; }

.note-form .cancel-link { color: #888; text-decoration: none; font-size: 0.9rem; }

.note-form .cancel-link:hover { color: #2c3e50; }
