* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    line-height: 1.5;
    min-height: 100vh;
}
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 24px;
}
h1 { font-size: 1.4rem; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin-bottom: 16px; }
.subtitle { color: #666; font-size: .9rem; margin-bottom: 20px; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; margin-top: 14px; }
input[type="text"], input[type="password"], input[type="email"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s;
}
input:focus, textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
textarea { resize: vertical; min-height: 160px; }
button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    background: #3b82f6;
    color: #fff;
    transition: background .15s;
}
button:hover { background: #2563eb; }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #e5e7eb; color: #374151; }
button.secondary:hover { background: #d1d5db; }
button.danger { background: #ef4444; }
button.danger:hover { background: #dc2626; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hint { font-size: .8rem; color: #6b7280; margin-top: 4px; }
.counter { font-size: .8rem; color: #6b7280; text-align: right; margin-top: 4px; }
.counter.over { color: #dc2626; font-weight: 600; }
.status { margin-top: 14px; font-size: .9rem; padding: 10px 12px; border-radius: 6px; display: none; }
.status.show { display: block; }
.status.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.link { color: #3b82f6; text-decoration: none; font-size: .9rem; }
.link:hover { text-decoration: underline; }
.auth-wrap { max-width: 420px; margin: 60px auto; }
.footer-link { text-align: center; margin-top: 16px; font-size: .875rem; color: #666; }

/* 拖拽验证 */
.drag-box {
    position: relative;
    height: 44px;
    background: #f3f4f6;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    margin-top: 16px;
    overflow: hidden;
    user-select: none;
}
.drag-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0;
    background: #d1fae5;
    transition: width .05s linear;
}
.drag-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; color: #6b7280;
    pointer-events: none;
}
.drag-handle {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 44px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    font-size: 1.1rem; color: #374151;
    z-index: 2;
}
.drag-handle:active { cursor: grabbing; }
.drag-box.success { border-color: #10b981; }
.drag-box.success .drag-handle { background: #10b981; color: #fff; border-color: #10b981; cursor: default; }

/* 列表页 */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.user-chip { font-size: .85rem; color: #6b7280; }
.note-row {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    transition: box-shadow .15s;
}
.note-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.note-row .info { flex: 1; min-width: 200px; }
.note-row .title { font-size: 1rem; font-weight: 600; color: #111827; margin-bottom: 4px; word-break: break-word; }
.note-row .title .lock-icon { font-size: .9rem; margin-right: 4px; }
.note-row .meta { font-size: .78rem; color: #9ca3af; display: flex; gap: 14px; flex-wrap: wrap; }
.note-row .meta span { white-space: nowrap; }
.note-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note-row .actions button { padding: 6px 14px; font-size: .82rem; }
.empty { text-align: center; padding: 40px 0; color: #9ca3af; font-size: .9rem; }

/* 模态框 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    padding: 16px;
}
.modal { background: #fff; border-radius: 8px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-sm { max-width: 400px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.modal-close {
    background: none; border: none; font-size: 1.3rem; cursor: pointer;
    color: #9ca3af; padding: 0 6px; line-height: 1;
}
.modal-close:hover { color: #374151; background: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.view-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; word-break: break-word; }
.view-meta { font-size: .78rem; color: #9ca3af; margin-bottom: 12px; }
.view-body {
    white-space: pre-wrap; word-break: break-word;
    font-size: .95rem; max-height: 50vh; overflow-y: auto;
    padding: 12px; background: #f9fafb; border-radius: 6px;
}
.confirm-text { font-size: .95rem; color: #374151; margin: 8px 0; }
.hidden { display: none !important; }

/* 编辑器页 */
.editor-wrap { max-width: 760px; margin: 0 auto; }