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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", Roboto, sans-serif;
    background: #f4f5f7;
    color: #222;
    line-height: 1.5;
}

/* ===== Login ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4a6cf7, #6f86ff);
    padding: 16px;
}

.login-container {
    background: #fff;
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.login-container h1 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: #333;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.login-form input:focus {
    outline: none;
    border-color: #4a6cf7;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #4a6cf7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-login:active {
    background: #3a5ce0;
}

.error-msg {
    background: #fdecea;
    color: #c0392b;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 12px;
    text-align: center;
}

/* ===== Topbar ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #4a6cf7;
    color: #fff;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 1.1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.btn-logout {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
}

/* ===== Main ===== */
.main-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}

.memo-editor {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.memo-editor input[type="text"],
.memo-editor textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 10px;
    resize: vertical;
}

.memo-editor input[type="text"]:focus,
.memo-editor textarea:focus {
    outline: none;
    border-color: #4a6cf7;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-primary {
    background: #4a6cf7;
    color: #fff;
}

.btn-primary:active {
    background: #3a5ce0;
}

.btn-secondary {
    background: #e9ecef;
    color: #333;
}

.btn-secondary:active {
    background: #dadfe4;
}

.memo-list-section h2 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
}

.memo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memo-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.memo-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.memo-item-header h3 {
    font-size: 1rem;
    color: #222;
    word-break: break-all;
}

.memo-date {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

.memo-preview {
    font-size: 0.9rem;
    color: #555;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 10px;
}

.memo-item-actions {
    display: flex;
    gap: 8px;
}

.memo-item-actions button {
    padding: 8px 14px;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-edit {
    background: #e7f0ff;
    color: #4a6cf7;
}

.btn-delete {
    background: #fdecea;
    color: #e74c3c;
}

.empty-msg {
    text-align: center;
    color: #999;
    padding: 24px 0;
    font-size: 0.9rem;
}

/* ===== Mobile ===== */
@media (max-width: 480px) {
    .topbar h1 {
        font-size: 1rem;
    }

    .main-container {
        padding: 12px;
    }

    .memo-item-header {
        flex-direction: column;
        gap: 4px;
    }
}
